|
@@ -10,7 +10,7 @@
|
|
|
borderColor: borderColor,
|
|
|
textAlign: inputAlign
|
|
|
}"
|
|
|
- @tap.stop="inputClick"
|
|
|
+ @click="inputClick"
|
|
|
>
|
|
|
<textarea
|
|
|
v-if="type == 'textarea'"
|
|
@@ -34,6 +34,10 @@
|
|
|
@focus="onFocus"
|
|
|
@confirm="onConfirm"
|
|
|
/>
|
|
|
+ <view v-else-if="type === 'select'" class="u-input__input">
|
|
|
+ <view :style="placeholderStyle" v-if="!defaultValue">{{placeholder}}</view>
|
|
|
+ <view v-else style="line-height: normal;padding: 15rpx 0;">{{defaultValue}}</view>
|
|
|
+ </view>
|
|
|
<input
|
|
|
v-else
|
|
|
class="u-input__input"
|
|
@@ -43,7 +47,7 @@
|
|
|
:password="type == 'password' && !showPassword"
|
|
|
:placeholder="placeholder"
|
|
|
:placeholderStyle="placeholderStyle"
|
|
|
- :disabled="disabled || type === 'select'"
|
|
|
+ :disabled="disabled"
|
|
|
:maxlength="inputMaxlength"
|
|
|
:focus="focus"
|
|
|
:confirmType="confirmType"
|
|
@@ -58,16 +62,16 @@
|
|
|
@confirm="onConfirm"
|
|
|
/>
|
|
|
<view class="u-input__right-icon u-flex">
|
|
|
- <view class="u-input__right-icon__clear u-input__right-icon__item" @tap="onClear" v-if="clearable && value != '' && focused">
|
|
|
+ <view class="u-input__right-icon__clear u-input__right-icon__item" @tap.stop="onClear" v-if="clearable && value != '' && (type !== 'select'?focused:true)">
|
|
|
<u-icon size="32" name="close-circle-fill" color="#c0c4cc"/>
|
|
|
</view>
|
|
|
<view class="u-input__right-icon__clear u-input__right-icon__item" v-if="passwordIcon && type == 'password'">
|
|
|
- <u-icon size="32" :name="!showPassword ? 'eye' : 'eye-fill'" color="#c0c4cc" @click="showPassword = !showPassword"/>
|
|
|
+ <u-icon size="32" :name="!showPassword ? 'eye' : 'eye-fill'" color="#c0c4cc" @click.stop="showPassword = !showPassword"/>
|
|
|
</view>
|
|
|
<view class="u-input__right-icon--select u-input__right-icon__item" v-if="type == 'select'" :class="{
|
|
|
'u-input__right-icon--select--reverse': selectOpen
|
|
|
}">
|
|
|
- <u-icon name="arrow-down-fill" size="26" color="#c0c4cc"></u-icon>
|
|
|
+ <u-icon name="arrow-right" size="26" color="#c0c4cc"></u-icon>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -334,7 +338,8 @@ export default {
|
|
|
this.$emit('confirm', e.detail.value);
|
|
|
},
|
|
|
onClear(event) {
|
|
|
- this.$emit('input', '');
|
|
|
+ this.handleInput({detail:{value:''}})
|
|
|
+ this.$emit('clear', '');
|
|
|
},
|
|
|
inputClick() {
|
|
|
this.$emit('click');
|