我想在组件中渲染属性。
我在模板中:
<v-flex v-for="c in components">
<component :is="c.component" v-bind="c.prop"></component>
</v-flex>
并且在脚本中:
...
mounted(){
this.components.push({,
component: "input",
prop: {type:"checkbox", v-text:"My CheckBox"}
})
它可以使用任何组件或属性。但是问题是当我尝试渲染v-text时。我认为是因为-
我如何成功呈现v文本?
首先,未加引号的属性名称只能包含字母数字,_
和$
。因此,要包含-
,您需要引用它:
{ "v-text": "My Checkbox" }