請問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'] }} })
請問vue 子組件模板 怎么用父組件傳遞的html字符串?
慕桂英546537
2018-11-12 15:18:09