mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-24 18:36:51 +08:00
datetime picker
This commit is contained in:
parent
ffcb610711
commit
09b4686860
@ -57,18 +57,24 @@ export default {
|
|||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
innerValue: this.val
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
value(val) {
|
value(val) {
|
||||||
this.innerValue = val;
|
this.innerValue = val;
|
||||||
|
},
|
||||||
|
innerValue(val) {
|
||||||
|
console.log(val + '!!!');
|
||||||
|
this.$emit('input', val);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
ranges() {
|
ranges() {
|
||||||
|
console.log(this.innerValue + '!!');
|
||||||
|
// return this.innerValue + '!!';
|
||||||
if (this.type === 'time') {
|
if (this.type === 'time') {
|
||||||
return [
|
return [
|
||||||
[this.minHour, this.maxHour],
|
[this.minHour, this.maxHour],
|
||||||
@ -176,6 +182,7 @@ debugger
|
|||||||
this.$emit('confirm', this.innerValue);
|
this.$emit('confirm', this.innerValue);
|
||||||
},
|
},
|
||||||
handlePickerChange(picker, values, index) {
|
handlePickerChange(picker, values, index) {
|
||||||
|
console.log(this.innerValue);
|
||||||
let value;
|
let value;
|
||||||
|
|
||||||
if (this.type === 'time') {
|
if (this.type === 'time') {
|
||||||
@ -194,10 +201,9 @@ debugger
|
|||||||
}
|
}
|
||||||
value = new Date(year, month - 1, date, hour, minute);
|
value = new Date(year, month - 1, date, hour, minute);
|
||||||
}
|
}
|
||||||
debugger
|
|
||||||
this.innerValue = value;
|
this.innerValue = value;
|
||||||
console.log(value);
|
console.log(value, this.innerValue);
|
||||||
this.$emit('input', value);
|
// this.$emit('input', value);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user