我想问。如果我在日期选择器中下个月单击图标,如何添加按钮单击以调用方法?
我该怎么办?
更新:
我正在使用vuetify:https://vuetifyjs.com/en/components/date-pickers#date-pickers-allowed-dates
答案 0 :(得分:1)
您可以尝试
Failed to decode downloaded font: http://localhost/%7B%7Bicofont%7D%7D
答案 1 :(得分:1)
可能您正在寻找这样的东西:
https://vuetifyjs.com/en/components/date-pickers#date-pickers-react-to-displayed-month-year-change
基本上,您应该使用picker-date.sync
道具,并使用观察者来观察其变化。
<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 :(得分:0)
我在 Vuetify 的 v-date-picker 上得到了这些事件
在模板中:
#include "other.h"
template<typename T>
T add(T a, T b){
return a+b;
}
//instantiation for int without declspec macro, compiles!
template int add<int>(int, int);
//specialization for double without declspec macro, doesn't compile!
template <> double add<double>(double a, double b){
return a-b;
}
//Specialization for double with declspec macro, compiles!
/*template <> OTHER_EXPORT double add<double>(double a, double b){
return a-b;
}*/
在脚本中:
<v-date-picker
ref="cal"
...
>
你可以覆盖 aria-label
mounted() {
var vm = this;
document.querySelector("[aria-label='Next month']").addEventListener('click', function () {
console.log('next');
var yyyy_mm = vm.$refs.cal.$data.tableDate;
console.log(yyyy_mm);
})
document.querySelector("[aria-label='Previous month']").addEventListener('click', function () {
console.log('previous');
var yyyy_mm = vm.$refs.cal.$data.tableDate;
console.log(yyyy_mm);
})
}