You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
860 B

<import src="../common/template/badge" />
<import src="../common/template/icon" />
<wxs src="../common/utils.wxs" module="_" />
<view
class="{{_.cls(classPrefix, [['active', active], ['disabled', disabled]])}} class {{prefix}}-class"
style="{{_._style([style, customStyle])}}"
bind:tap="handleClick"
aria-role="button"
aria-label="{{ active ? '已选中' + label : label}}"
aria-disabled="{{disabled}}"
>
<block wx:if="{{active}}">
<view class="{{classPrefix}}__line"></view>
<view class="{{classPrefix}}__prefix"></view>
<view class="{{classPrefix}}__suffix"></view>
</block>
<template wx:if="{{_icon}}" is="icon" data="{{ class: classPrefix + '__icon', ..._icon }}" />
<block wx:if="{{badgeProps}}">
<template is="badge" data="{{ ...badgeProps, content: label }}" />
</block>
<block wx:else>{{label}}</block>
</view>