<component v-bind:is="who"></component>
const coma={
template:`<h1>a</h1>`
}
const comb={
template:`<h1>b</h1>`
}
const comc={
template:`<h1>c</h1>`
}
var vm=new Vue({
el:'#app',
data:{
who:"coma"
},
components:{
"coma":coma,
"comb":comb,
"comc":comc
}
})
component标签使用
最新推荐文章于 2023-04-08 20:37:28 发布