如果你对该文章中的内容有疑问/不解,可以点击此处链接提问
要注明问题和此文章链接地址 点击此处跳转
Component({
/**
* 组件的属性列表
*/
options:{
// 启用多插槽
multipleSlots:true
},
properties: {
text:String
},
})
//定义
<view class='container'>
<text>{{text}}</text>
<!-- 插槽 -->
<slot name="after"></slot>
</view>
//使用
<v-tag text = "{{item.content}}" >
<text class='num' slot="after">{{'+'+item.nums}}</text>
</v-tag>
王明昌博客
