Update form-select-and-other.vue

This commit is contained in:
huxuejian 2026-09-15 13:56:32 +08:00
parent d503710595
commit 23d8fbd88a

View File

@ -2,9 +2,13 @@
<common-cell :name="name" :required="required"> <common-cell :name="name" :required="required">
<view class="select-other"> <view class="select-other">
<picker mode="selector" :range="range" :disabled="disableChange" @change="changeSelect"> <picker mode="selector" :range="range" :disabled="disableChange" @change="changeSelect">
<view class="select-other__picker" :class="selectedValue ? '' : 'form__placeholder'">{{ selectedValue || '请选择' }}</view> <view class="select-other__picker" :class="selectedValue ? '' : 'form__placeholder'">
{{ selectedValue || '请选择' }}
</view>
</picker> </picker>
<input v-if="showOther" class="select-other__input" :disabled="disableChange" :value="otherValue" placeholder="请填写其他原因" @input="changeOther" /> <view v-if="showOther" class="select-other__input">
<input :disabled="disableChange" :value="otherValue" placeholder="请填写其他原因" @input="changeOther" />
</view>
</view> </view>
</common-cell> </common-cell>
</template> </template>
@ -52,7 +56,21 @@ function changeOther(event) { emits('change', { title: props.title, value: event
<style> <style>
@import '../cell-style.css'; @import '../cell-style.css';
.select-other { width: 100%; } .select-other {
.select-other__picker, .select-other__input { box-sizing: border-box; width: 100%; padding: 12rpx 16rpx; border: 1rpx solid #dcdfe6; border-radius: 8rpx; font-size: 28rpx; } width: 100%;
.select-other__input { margin-top: 14rpx; } }
.select-other__picker,
.select-other__input {
box-sizing: border-box;
width: 100%;
padding: 12rpx 16rpx;
border: 1rpx solid #dcdfe6;
border-radius: 8rpx;
font-size: 28rpx;
}
.select-other__input {
margin-top: 14rpx;
}
</style> </style>