首页 文章

单击路由器视图时,vuex中的未定义值

提问于
浏览
2

我正在使用vue-tables-2组件,并将选项设置为使用Vuex:

Vue.use(ClientTable, [], true, null)

我的表格单元格中有一个 <router-view> ,链接到另一个页面,当我点击它时,我在vuex中收到有关未定义数据的错误 .

vuex.js:34 Uncaught TypeError: Cannot read property 'data' of undefined
    at VueComponent.tableData (vuex.js:34)
    at Watcher.get (vue.common.js:3035)
    at Watcher.evaluate (vue.common.js:3142)
    at VueComponent.computedGetter [as tableData] (vue.common.js:3427)
    at VueComponent../node_modules/vue-tables-2/compiled/methods/row-was-clicked.js.module.exports (row-was-clicked.js:9)
    at Proxy.boundFn (vue.common.js:187)
    at invoker (vue.common.js:1939)
    at HTMLTableRowElement.fn._withTask.fn._withTask (vue.common.js:1774)

有没有办法告诉vuex当我离开这个组件时我不再使用它了?

1 回答

相关问题