項目中用到element-ui, 比如說我要動態生成N個組件。<template><div class="search" ref="search" v-html="sHtml"></div></template><script type="text/javascript">export default { data() { return { sHtml: '', } }, props: { con: { type: Array } }, created() { this.con.map((v, i) => { this.sHtml += '<el-'+ v.type +' class="'+ v.style +'" placeholder="'+ v.placeholder +'" v-model="'+ v.name +'"></el-' + v.type +'>'; }); },}</script>有什么辦法可以讓element插件渲染出在頁面中呢?
vue 拼接出來的組件有什么辦法可以讓組件生效嘛
慕森卡
2018-11-13 17:13:49