此时引用组件会报错
Unknown custom element: <preview-form> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
解决办法
装饰器必须直接位于导出的类之前
示例:
@Component({
name: "ArchiveReviewForm",
components: {
PreviewForm
},
})
export class ArchiveReviewForm{}
在Vue应用中遇到<preview-form>组件未知错误,提示未正确注册。解决方案是确保在@Component装饰器中定义'components'选项并提供'名称'。示例代码显示了如何在ArchiveReviewForm类前正确使用@Component装饰器来注册组件。
1万+

被折叠的 条评论
为什么被折叠?



