我想从vue中的动态变量名加载组件.js应用程序.
我注册了以下组件:
<template id="goal">
<h1>Goal:{{data.text}}</h1>
</template>
而不是像这样加载它
<goal></goal>
我想从一个变量名加载,比如:
<{{mytemplate.type}}></{{mytemplate.type}}>
当然,我的模板.在这种情况下,类型将等于"目标"
我想从vue中的动态变量名加载组件.js应用程序.
我注册了以下组件:
<template id="goal">
<h1>Goal:{{data.text}}</h1>
</template>
而不是像这样加载它
<goal></goal>
我想从一个变量名加载,比如:
<{{mytemplate.type}}></{{mytemplate.type}}>
当然,我的模板.在这种情况下,类型将等于"目标"
使用这样的dynamic component:
<component :is="myTemplate.type"></component>