问题
I want to ask. How can I add button click for call a method if I click icon next month in the datepicker?
Look at this :
How can I do it?
Update :
I using vuetify : https://vuetifyjs.com/en/components/date-pickers#date-pickers-allowed-dates
回答1:
Probably you're looking for something like this:
https://vuetifyjs.com/en/components/date-pickers#date-pickers-react-to-displayed-month-year-change
Basically you should use the picker-date.sync
prop and watch for its changes using a watcher.
<v-date-picker v-model="date" :picker-date.sync="pickerDate"/>
export default {
data() {
return {
date: new Date().toISOString().substr(0, 10),
pickerDate: null,
}
),
watch: {
pickerDate (newval,oldval) {
// here you can check if month changed using newval and oldval
},
},
}
回答2:
You can try this
$(document).on('click', '.ui-datepicker-next', function () {
console.log('next');
})
$(document).on('click', '.ui-datepicker-prev', function () {
console.log('prev');
})
来源:https://stackoverflow.com/questions/58374477/how-can-i-add-button-click-for-call-a-method-if-i-click-icon-next-month-in-the-d