mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-22 12:56:45 +08:00
添加校验
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
<template>
|
||||
<div>
|
||||
<van-cell-group @click.native="showPopup">
|
||||
<van-field v-bind="$attrs" right-icon="arrow" v-model="value" :required="required" :readonly="readonly" />
|
||||
<van-field v-bind="$attrs" right-icon="arrow" :value="value" :required="required" :readonly="readonly" />
|
||||
</van-cell-group>
|
||||
<van-popup id="popup" :value="isShow" :position="position" @click-overlay="closePopup">
|
||||
<slot :closePopup="closePopup">
|
||||
<van-picker id="picker" show-toolbar :columns="columns" />
|
||||
<van-picker id="picker" show-toolbar :columns="columns" @confirm="onPickerConfirm" @cancel="closePopup" />
|
||||
</slot>
|
||||
</van-popup>
|
||||
</div>
|
||||
@@ -13,8 +13,11 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'PopupSelectorq',
|
||||
name: 'PopupSelector',
|
||||
props: {
|
||||
value: {
|
||||
type: String
|
||||
},
|
||||
position: {
|
||||
type: String,
|
||||
default: 'bottom'
|
||||
@@ -36,17 +39,19 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
value: '',
|
||||
isShow: false
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
showPopup() {
|
||||
this.isShow = true
|
||||
},
|
||||
closePopup() {
|
||||
this.isShow = false
|
||||
},
|
||||
onPickerConfirm(pickedValue) {
|
||||
this.$emit('input', String(pickedValue))
|
||||
this.closePopup()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user