子组件怎么用父组件传递的html字符串
1个回答
展开全部
<div id="app"> <child :para="this.argus" :temp="this.html"></child></div><script> var vm = new Vue({ el: "#app", data: { html: `<video></video>`, argus: {src:"movie.ogg", controls:"controls"} }, components: { child: { functional: true, render:(h, context)=> { const temp = context.props.temp; const para = context.props.para; return h({template: temp}, { attrs: para }) }, props: { temp: { type: String, required: true }, para: { type: Object, required: true } } } }})</script>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询