30 lines
1.0 KiB
XML

<view class="am-search {{className}}">
<view class="am-search-input">
<view class="am-search-synthetic">
<view>
<view class="am-search-synthetic-icon"></view>
<text class="am-search-synthetic-placeholder" style="{{ visibility: !focus && _value.length === 0 ? 'visible': 'hidden'}}">{{placeholder}}</text>
</view>
</view>
<input
enableNative="{{false}}"
class="am-search-value"
confirm-type="search"
value="{{_value}}"
focus="{{focus}}"
maxlength="{{maxLength}}"
disabled="{{disabled}}"
onInput="handleInput"
onFocus="handleFocus"
onConfirm="handleConfirm"
sync-input="{{true}}"
onBlur="handleBlur" />
<view class="am-search-clear {{ _value.length > 0 && focus ? 'am-search-clear-show' : '' }}" onTap="handleClear">
<icon type="clear" size="14" />
</view>
</view>
<view
class="am-search-cancel am-search-anim {{ focus || showCancelButton ? 'am-search-repos' : '' }}"
onTap="handleCancel">取消</view>
</view>