如何从API或字符串变量加载和呈现“页面组件”模板?例如pageContent = "<Header/><Slider/><NewArrivals/><Footer/>"
。我想渲染这个字符串。有没有可用的方法?
我尝试过了
<script>
import List from '~/components/account/role/List.vue'
export default {
components: {
List
},
template: this.pageContent,
data: () => {
return {
pageContent: '<div class="row"><List class="col-lg-12"/></div>',
}
}
}
</script>
所以我遇到了错误;
render function or template not defined in component: anonymous