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.

52 lines
1.7 KiB

<wxs src="../common/utils.wxs" module="_" />
<view style="{{_._style([style, customStyle])}}" class="class {{classPrefix}} {{prefix}}-class">
<view
class="{{classPrefix}}__input-box {{prefix}}-{{localValue.focus ? 'is-focused' : 'not-focused'}} {{classPrefix}}__input-box--{{center ? 'center' : ''}} {{classPrefix}}__input-box--{{shape}} {{prefix}}-class-input-container"
>
<!-- <view wx:if="{{label}}" class="{{classPrefix}}__label {{prefix}}-class-label">{{label}}</view>
<slot name="label" /> -->
<t-icon
wx:if="{{leftIcon}}"
name="{{leftIcon}}"
size="24"
class="{{prefix}}-icon {{prefix}}-class-left"
aria-hidden="{{true}}"
/>
<slot name="left-icon" />
<input
type="text"
name="input"
disabled="{{disabled}}"
class="{{prefix}}-input__keyword {{prefix}}-class-input"
focus="{{localValue.focus}}"
value="{{value}}"
confirm-type="search"
placeholder="{{placeholder}}"
placeholder-class="{{classPrefix}}__placeholder {{classPrefix}}__placeholder--{{center ? 'center': 'normal'}}"
bind:input="onInput"
bind:focus="onFocus"
bind:blur="onBlur"
bind:confirm="onConfirm"
/>
<view
wx:if="{{value !=='' && clearable}}"
class="{{classPrefix}}__clear {{prefix}}-class-clear"
bind:tap="handleClear"
aria-role="button"
aria-label="清除"
>
<t-icon name="close-circle-filled" size="24" />
</view>
</view>
<view
wx:if="{{action}}"
class="{{classPrefix}}__search-action {{prefix}}-class-action"
bindtap="onActionClick"
aria-role="button"
>
{{action}}
</view>
<slot name="action" />
</view>