Fork me on GitHub

TypeError: Cannot create property 'isRootInsert' on string 'xxx'报错

1. 错误

在写一个新组件的时候,在父组件里面注册就报错 TypeError: Cannot create property 'isRootInsert' on string 'xxx'

 

 

2. 原因

原因是在子组件中没有写@Component({})

无论子组件中有没有子子组件需要注册,都要写上@Component({})

 

 

posted @ 2021-06-28 14:51  zerozhupan  阅读(1970)  评论(0)    收藏  举报