mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-10-21 23:42:09 +08:00
parent
723cebac1a
commit
01ffc40686
@ -90,24 +90,30 @@ VantComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
value(val: any) {
|
value: 'updateValue',
|
||||||
|
type: 'updateValue',
|
||||||
|
minDate: 'updateValue',
|
||||||
|
maxDate: 'updateValue',
|
||||||
|
minHour: 'updateValue',
|
||||||
|
maxHour: 'updateValue',
|
||||||
|
minMinute: 'updateValue',
|
||||||
|
maxMinute: 'updateValue'
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
updateValue() {
|
||||||
const { data } = this;
|
const { data } = this;
|
||||||
val = this.correctValue(val);
|
const val = this.correctValue(this.data.value);
|
||||||
const isEqual = val === data.innerValue;
|
const isEqual = val === data.innerValue;
|
||||||
if (!isEqual) {
|
if (!isEqual) {
|
||||||
this.updateColumnValue(val).then(() => {
|
this.updateColumnValue(val).then(() => {
|
||||||
this.$emit('input', val);
|
this.$emit('input', val);
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
this.updateColumns();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
type: 'updateColumns',
|
|
||||||
minHour: 'updateColumns',
|
|
||||||
maxHour: 'updateColumns',
|
|
||||||
minMinute: 'updateColumns',
|
|
||||||
maxMinute: 'updateColumns'
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
getPicker() {
|
getPicker() {
|
||||||
if (this.picker == null) {
|
if (this.picker == null) {
|
||||||
const picker = (this.picker = this.selectComponent(
|
const picker = (this.picker = this.selectComponent(
|
||||||
@ -193,7 +199,7 @@ VantComponent({
|
|||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
correctValue(value) {
|
correctValue(value: any) {
|
||||||
const { data } = this;
|
const { data } = this;
|
||||||
// validate value
|
// validate value
|
||||||
const isDateType = data.type !== 'time';
|
const isDateType = data.type !== 'time';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user