javascript - vue在组建中加v-show报错怎么解决?
本文介绍了javascript - vue在组建中加v-show报错怎么解决?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
我定义了一个组件,在组建上加v-show抛出错误
Attribute "v-show" is ignored on component <parent> because the component is a fragment instance:
然后按到提示去了http://vuejs.org/guide/compon...结果纯英文,英文太差没看懂。。。
代码如下:
html
<div id="app">
<div>
<parent :display="display" v-show="display"></parent>
</div>
</div>
js
new Vue({
el:"#app",
data:{
"display":false
},
components:{
"parent":{
template:"#tem",
props:['display'],
data:function(){
return{
"myName":"jason",
"myAge":28,
"height":178,
}
},
components:{
"child":{
template:"#tem1",
props:['name','age','height','display'],
data:function(){
return{
"displayd":false
}
}
}
}
}
}
})
解决方案
这篇关于javascript - vue在组建中加v-show报错怎么解决?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文