40 lines
1.6 KiB
Plaintext
40 lines
1.6 KiB
Plaintext
|
<view 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 wx:else name="label" />
|
||
|
<t-icon wx:if="{{leftIcon}}" name="{{leftIcon}}" size="20px" class="{{prefix}}-icon {{prefix}}-class-left" />
|
||
|
<slot wx:else 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 !==''}}" class="{{classPrefix}}__right {{prefix}}-class-right" bind:tap="handleClear">
|
||
|
<t-icon
|
||
|
wx:if="{{rightIcon}}"
|
||
|
name="{{rightIcon}}"
|
||
|
class="{{prefix}}-icon"
|
||
|
size="18px"
|
||
|
color="rgba(187,187,187,1)"
|
||
|
/>
|
||
|
<slot wx:else name="right-icon" />
|
||
|
</view>
|
||
|
</view>
|
||
|
<view wx:if="{{action}}" class="{{classPrefix}}__search-action {{prefix}}-class-action" bindtap="onActionClick">
|
||
|
{{action}}
|
||
|
</view>
|
||
|
<slot wx:else name="action-text" />
|
||
|
</view>
|