1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <import-sjs
- from="./index.sjs"
- name="_sjs" />
- <view
- class="ant-badge {{ className || '' }}"
- style="{{ style }}">
- <view class="ant-badge-body">
- <slot />
- </view>
- <view
- a:if="{{ type === 'dot' }}"
- class="ant-badge-content"
- style="{{ _sjs.setPositionStyle(position, offsetX, offsetY) }}">
- <view
- class="ant-badge-dot {{ stroke ? 'ant-badge-dot-stroke' : '' }}"
- style="{{ bgColor ? 'background-color: ' + bgColor + ';' : '' }}" />
- </view>
- <view
- a:else
- class="ant-badge-content ant-badge-content-not-dot {{ type === 'bubble' ? 'ant-badge-content-' + position + '-bubble' : '' }} {{ stroke ? 'ant-badge-content-stroke' : '' }}"
- style="{{ bgColor ? 'background-color: ' + bgColor + ';' : '' }} {{ _sjs.setBubbleStyle(type, position) }};{{ _sjs.setPositionStyle(position, offsetX, offsetY) }}">
- <view class="ant-badge-icon-container" />
- <view class="ant-badge-content-text">
- <slot name="text">
- <view
- a:if="{{ type === 'number' }}"
- class="ant-badge-number">
- <!-- display: inline -->
- <text a:if="{{ _sjs.getOverCount(text) }}">99+</text>
- <!-- display: inline -->
- <text a:else>{{ text }}</text>
- </view>
- <view
- a:if="{{ type === 'text' }}"
- class="ant-badge-text">
- {{ text }}
- </view>
- <view
- a:if="{{ type === 'bubble' }}"
- class="ant-badge-bubble">
- {{ text }}
- </view>
- </slot>
- </view>
- </view>
- </view>
|