uniapp报错Injection “list” not found

[Vue warn]: Injection “list” not found
14:55:22.199 found in
14:55:22.239 —> at C:/Users/Administrator/Desktop/yuncheng/components/uni-list-item/uni-list-item.vue
14:55:22.262
14:55:22.279 [Vue warn]: Injection “list” not found
14:55:22.321 found in
14:55:22.362 —> at C:/Users/Administrator/Desktop/yuncheng/components/uni-list-item/uni-list-item.vue
14:55:22.381
14:55:22.401 [Vue warn]: Injection “list” not found
14:55:22.441 found in
14:55:22.481 —> at C:/Users/Administrator/Desktop/yuncheng/components/uni-list-item/uni-list-item.vue
14:55:22.505
14:55:22.527 TypeError: undefined is not an object (evaluating ‘this.list.firstChildAppend’)
14:55:22.548 TypeError: undefined is not an object (evaluating ‘this.list.firstChildAppend’)
14:55:22.568 TypeError: undefined is not an object (evaluating ‘this.list.firstChildAppend’)
14:55:25.498 [Vue warn]: Injection “list” not found
14:55:25.546 found in
14:55:25.586 —> at C:/Users/Administrator/Desktop/yuncheng/components/uni-list-item/uni-list-item.vue
14:55:25.607
14:55:25.627 [Vue warn]: Injection “list” not found
14:55:25.666 found in
14:55:25.707 —> at C:/Users/Administrator/Desktop/yuncheng/components/uni-list-item/uni-list-item.vue
14:55:25.726
14:55:25.746 TypeError: undefined is not an object (evaluating ‘this.list.firstChildAppend’)
14:55:25.766 TypeError: undefined is not an object (evaluating ‘this.list.firstChildAppend’)


·回复

你试试这种格式

<uni-list>  
            <uni-list-item title="第一行"></uni-list-item>  
            <uni-list-item title="第二行"></uni-list-item>  
</uni-list>

版本更新了,增加了uni-list组件,需要用父组件包起来,provide,inject的传递。我也是看以前的视频教程发现这个错误。

发表评论

电子邮件地址不会被公开。 必填项已用*标注

Scroll Up