【发布时间】:2021-01-31 09:52:21
【问题描述】:
我有一个包含四个组件的 Vue 应用程序:
A,B,C,D
在一个特定的模板中我有这种情况:
A 嵌套在 D 中嵌套在 C 中嵌套在 B 中嵌套在 A 中
但是当我执行页面时,我得到了这个错误:
Uncaught ReferenceError: Cannot access '__WEBPACK_DEFAULT_EXPORT__' before initialization
at Module.default (VM989 A.vue:3)
at eval (C.ts:37)
at Object../src/C.ts (bundle.js?v=Eyk_ReZs3kIu049BgV_w3FBVLlup9glNBHL1Wa04y2A:548)
如果我改变这部分:
@Component({
name: 'C',
components: {
'A': A
}
})
export default class C extends Vue { }
以这种(错误的)方式:
@Component({
name: 'C',
components: {
}
})
export default class C extends Vue { }
页面加载但我得到这个(正确的)错误:
[Vue warn]: Unknown custom element: <dataform> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
不知道是什么问题……
【问题讨论】:
标签: typescript vue.js webpack