我正在使用 vue-router,在其中一个组件/vue 中,我尝试在加载特定组件时从数据库加载历史事务:
<script>
import store from '../store'
export default {
data() {
return {
histories: []
}
},
route: {
activate() {
$this.getHistories()
}
},
methods: {
getHistories() {
$this.histories = store.getHistories()
}
}
}
</script>
我得到了这两个错误:
build.js:12642 [vue-router] Uncaught error during transition:
build.js:28551 Uncaught ReferenceError: $this is not defined