forked from Tencent/tdesign-miniprogram
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
2 changed files
with
25 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
<wxs src="./badge.wxs" module="this" /> | ||
|
||
<view style="{{ customStyle }}" class="{{this.getBadgeOuterClass({shape})}} {{prefix}}-class"> | ||
<view class="{{classPrefix}}__content {{prefix}}-class-content"> | ||
<view | ||
style="{{ customStyle }}" | ||
class="{{this.getBadgeOuterClass({shape})}} {{prefix}}-class" | ||
aria-labelledby="labelledby" | ||
aria-describedby="describedby" | ||
aria-role="{{ ariaRole || 'option'}}" | ||
> | ||
<view id="labelledby" class="{{classPrefix}}__content {{prefix}}-class-content"> | ||
<slot wx:if="{{!content}}" class="{{classPrefix}}__content-slot" /> | ||
<text wx:else class="{{classPrefix}}__content-text">{{content}}</text> | ||
</view> | ||
<view | ||
aria-label="{{ this.getBadgeAriaLabel({dot, count, maxCount}) }}" | ||
id="describedby" | ||
wx:if="{{count !== 'slot' && this.isShowBadge({dot,count,showZero})}}" | ||
class="{{this.getBadgeInnerClass({dot, size, shape, count})}} {{prefix}}-has-count {{prefix}}-class-count" | ||
style="{{this.getBadgeStyles({color, offset})}}" | ||
>{{ this.getBadgeValue({dot, count, maxCount}) }} | ||
</view> | ||
<slot name="count" wx:if="{{count === 'slot' || !count}}" /> | ||
<slot id="describedby" name="count" wx:if="{{count === 'slot' || !count}}" /> | ||
</view> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters