扫码关注官方订阅号
{{message2}}
以上代码出现报错
求大神告知这为什么,应该如何修改,使得子组件里可以嵌套孙组件。
闭关修行中......
组件的template只能有一个祖先级节点
template
局部注册组件使用components而不是component
components
component
Vue.component('parent' , { template:'<p>this is parent template</p><child1></child1>', component:{ "child1":child2 } }) // template:'<p>this is parent template</p><child1></child1>',在外面套一层p template:'<p><p>this is parent template</p><child1></child1></p>'。因为vue需要root Element.错误提示。
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
组件的
template只能有一个祖先级节点局部注册组件使用
components而不是component