So I'm using Element Vue, I need to get access to a method or to the value of the acceptedDates
export default {
data() {
return {
acceptedDates: [],
pickerOptions1: {
disabledDate(time) {
return moment(time).isBetween(this.acceptedDates[0], this.acceptedDates[1]);
}
}
};
},
methods: {
//setting acceptedDates method...
}
I get a ReferenceError for this.accptedDates or even without using this. How do you do this?
Update Thank you for the first anwsers, but I still can't figure it out. I created this fiddle for you to see: https://jsfiddle.net/05nru5xq/13/
If you go to http://element.eleme.io/#/en-US/component/date-picker you will find that disabledDate is a Function in PickerOption.
datais only to specify variables and it's default values, you havemethodsandcomputedto actually process the data, plus you havemounted()orbeforeMounted()to initialize anything you might need2018-01-20for example