我在vue中有一个非常简单的组件,它在组件加载后从挂载的钩子执行函数。
methods: {
pushFolders: function() {
$.each(this.$store.state.folders.subFolders, function(key, value) {
this.selected.push(value.uuid)
}.bind(this));
},
checkAll: function(){
this.isSelectedAll = !this.isSelectedAll;
this.selectedFolders = [];
if(this.isSelectedAll){ // Check all
// this.selectedFolders.push(this.selected[key]);
this.$store.dispatch('SELECT_FOLDERS',this.selected)
}
}
},
mounted: function() {
this.pushFolders()
}当我加载组件所在的路由时,我得到这个错误:
Error in mounted hook: "TypeError: e is undefined"有谁能解释一下这件事吗?
https://stackoverflow.com/questions/50038822
复制相似问题