like the following code, how can I get form.datefrom in onClick.
my original requirement is to have a shortcut to implement the date of the form.datefrom+1 year
data() {
return {
form: { tenants: [], datefrom: new Date() },
loading: false,
daterangeOptions: {
disabledDate: (time) => {
const beginDateVal = this.$moment(this.form.datefrom)
if (beginDateVal) {
return this.$moment(time) < beginDateVal
}
},
shortcuts: [{
text: "",
onClick(picker) {
picker.$emit("pick", this.$moment(this.form.datefrom).add(1, "y"))
}
}, {
text: "",
onClick(picker) {
picker.$emit("pick", this.$moment(this.form.datefrom).add(6, "M"))
}
}, {
text: "",
onClick(picker) {
picker.$emit("pick", this.$moment(this.form.datefrom).add(3, "M"))
}
}, {
text: "",
onClick: (picker) => {
debugger
picker.$emit("pick", this.$moment(this.form.datefrom).add(1, "M"))
}
}]
}
}
}