请问vue 子组件模板 怎么用父组件传递的html字符串?
父组件要传递一段html到子组件。
下面的写法报错 Component template requires a root element, rather than just text。
<div id="app">
<comp :temp="this.temp"></comp>
</div>
var vm=new Vue({
el:"#app",
data:{
temp:"<div>1234</div>"
},
components:{
"comp":{
template:'this.temp',
props:['temp']
}}
})
慕桂英546537
动漫人物
随时随地看视频慕课网APP
相关分类