123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <import src="../common/template/icon.wxml" />
- <wxs src="../common/utils.wxs" module="_" />
- <wxs src="./avatar.wxs" module="this" />
- <view
- class="{{classPrefix}}__wrapper class {{prefix}}-class"
- style="{{_._style([this.getStyles(isShow, zIndex), style, customStyle])}}"
- >
- <t-badge
- color="{{badgeProps.color || ''}}"
- content="{{badgeProps.content || ''}}"
- count="{{badgeProps.count || 0}}"
- dot="{{badgeProps.dot || false}}"
- max-count="{{badgeProps.maxCount || 99}}"
- offset="{{badgeProps.offset || []}}"
- shape="{{badgeProps.shape || 'circle'}}"
- show-zero="{{badgeProps.showZero || false}}"
- size="{{badgeProps.size || 'medium'}}"
- t-class="{{badgeProps.tClass}}"
- t-class-content="{{badgeProps.tClassContent}}"
- t-class-count="{{badgeProps.tClassCount}}"
- >
- <view
- class="{{this.getClass(classPrefix, size, shape, bordered)}} {{prefix}}-class-image"
- style="{{this.getSize(size)}}"
- aria-label="{{ ariaLabel || alt ||'头像'}}"
- aria-role="{{ ariaRole || 'img'}}"
- aria-hidden="{{ ariaHidden }}"
- >
- <t-image
- wx:if="{{image}}"
- t-class="{{prefix}}-image {{classPrefix}}__image"
- t-class-load="{{prefix}}-class-alt"
- style="{{imageProps.style || ''}}"
- src="{{image}}"
- mode="{{imageProps.mode || 'aspectFill'}}"
- lazy="{{imageProps.lazy || false}}"
- loading="{{imageProps.loading || 'default'}}"
- shape="{{imageProps.shape || 'round'}}"
- webp="{{imageProps.webp || false}}"
- error="{{alt || 'default'}}"
- bind:error="onLoadError"
- />
- <template
- wx:elif="{{iconName || _.isNoEmptyObj(iconData)}}"
- is="icon"
- data="{{class: classPrefix + '__icon', tClass: prefix + '-class-icon', name: iconName, ...iconData}}"
- />
- <view wx:else class="{{classPrefix}}__text {{prefix}}-class-content">
- <slot />
- </view>
- </view>
- </t-badge>
- </view>
|