You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.1 KiB
52 lines
1.1 KiB
6 years ago
|
<template>
|
||
|
<div>
|
||
|
<van-field
|
||
|
v-model="value"
|
||
|
:required="required"
|
||
|
clearable
|
||
|
readonly
|
||
|
:label="label"
|
||
|
@click="onPick">
|
||
|
<van-stepper
|
||
|
slot="input"
|
||
|
:value="value"
|
||
|
@change="onChange"/>
|
||
|
</van-field>
|
||
|
</div>
|
||
|
</template>
|
||
|
<script>
|
||
|
import {
|
||
|
Field,
|
||
|
Stepper,
|
||
|
} from 'vant';
|
||
|
|
||
|
export default{
|
||
|
components: {
|
||
|
[Field.name]: Field,
|
||
|
[Stepper.name]: Stepper,
|
||
|
},
|
||
|
data(){
|
||
|
return {
|
||
|
showPopup: false,
|
||
|
value: '',
|
||
|
}
|
||
|
},
|
||
|
props: {
|
||
|
'label': String,
|
||
|
'required': Boolean
|
||
|
},
|
||
|
methods: {
|
||
|
onPick(){
|
||
|
this.showPopup = true;
|
||
|
},
|
||
|
onChange(value){
|
||
|
this.showPopup = false;
|
||
|
this.$emit('input', value);
|
||
|
}
|
||
|
},
|
||
|
mounted(){
|
||
|
}
|
||
|
}
|
||
|
|
||
|
</script>
|