<mynav>
<h1 slot="h1">我是具名插槽</h1>
<h2 slot="h2">我没有命名</h2>
</mynav>
let cp_template = {
mynav: {
template: `
<div style="color:red;">
<slot name="h2"></slot>
<slot name="h1"></slot>
</div>
`
}
}
const apps = new Vue({
el: '#app',
data() {
return {
msg: 'hello',
wkblxt: {},
menuIndex: 0
}
},
created() {
this.wkblxt = wkblxt.wkblxt
},
components: {
'mynav': cp_template.mynav
},
mounted: {
},
methods: {
}
})
标签:mynav,插槽,cdn,template,cp,vue2.2,wkblxt
From: https://www.cnblogs.com/lambertlt/p/18214964