EDIT: you could use to set a default value and have it changing afterwards.
data() {
return {
initialDate: Date.now(),
};
},
computed: {
dob: {
get() {
return this.initialDate;
},
set(newValue) {
this.initialDate = newValue;
},
},
},
Where is your input coming from ? It probably needs a UNIX timestamp like 1612454883231
. Try initializing it with Date.now()
or maybe try new Date().toISOString().slice(0,10)
.
Also, new Date('2006-03-05T00:00:00')
if you want to set it manually (and since it's a date of birth...).
If it doesn't work, you need to dig the documentation to see which format it accepts.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…