当我运行我的程序时,我得到以下错误:
Cannot read properties of undefined (reading 'get')
TypeError: Cannot read properties of undefined (reading 'get')
at Proxy.mounted (webpack-internal:///./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/views/HdHistory.vue?vue&type=script&lang=js:563:29)
at eval (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:2811:88)
at callWithErrorHandling (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:296:18)
at callWithAsyncErrorHandling (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:304:17)
at hook.__weh.hook.__weh (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:2791:19)
at flushPostFlushCbs (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:461:41)
at flushJobs (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:499:5)
这是我的代码:
mounted() {
Promise.all([
this.$http.get('/api/v0/tickets/divisions')
.then((response) => {
this.customer.items = response.data;
}),
this.$http.get('/api/v0/hd/groups')
.then((response) => {
this.groups.items.push(...response.data);
// by default select all
if (this.groups.selected.length === 0) this.groups.selected = this.groups.items
}),
])
.then(() => {
this.timeScaleSelected();
})
.catch((e) => {
console.error(e);
});
},
有人有什么想法吗?
我正在尝试将我的程序从vue2升级到vue3。
1条答案
按热度按时间odopli941#
检查
main.js
中您要使用的全局变量。Vue 2格式:
Vue 3格式: