badge.wxml 680 B

123456789101112131415
  1. <wxs src="./badge.wxs" module="this" />
  2. <view class="{{this.getBadgeOuterClass({shape})}} t-class">
  3. <view class="{{classPrefix}}__content t-class-content">
  4. <slot wx:if="{{!content}}" class="{{classPrefix}}__content-slot" />
  5. <text wx:else class="{{classPrefix}}__content-text">{{content}}</text>
  6. </view>
  7. <view
  8. wx:if="{{count !== 'slot' && this.isShowBadge({dot,count,showZero})}}"
  9. class="{{this.getBadgeInnerClass({dot, size, shape, count})}} t-has-count t-class-count"
  10. style="{{this.getBadgeStyles({color, offset})}}"
  11. >{{ this.getBadgeValue({dot, count, maxCount}) }}
  12. </view>
  13. <slot name="count" wx:if="{{count === 'slot' || !count}}" />
  14. </view>