小程序中插槽的使用

2019-06-29  本文已影响0人  皇甫圣坤
bind:tap = "" 事件绑定不会阻止冒泡事件 
catch:tap=""事件绑定可以阻止冒泡事件 
`子组件wxml`
<view class="container">
    <text>{{text}}</text>
    <slot name="after"></slot>
    <!-- solt -->
</view>
`子组件js`添加
  options:{
    multipleSlots:true
  },
<h-tag text="{{item.content}}">
     <text slot="after">{{'+'+item.nums}}</text>
</h-tag>
上一篇 下一篇

猜你喜欢

热点阅读