new Vue({
el: ‘#calendar‘,
data: {
currentDay: 1,
currentMonth: 1,
currentYear: 1970,
currentWeek: 1,
days: [],
addDay: [],
},
created: function() {
this.initData(null);
var $this = this;
//请求数据
$.ajax({
url: "这里填接口名称",
type: "POST",
data: {
name: ‘‘,
params: ‘‘
},
dataType: "json",
async: false,
success: function(data) {
console.log(data);
$this.addDay = data;
},
error: function(xhr) {
console.log(xhr);
}
});
},
methods: {
j: function(y, m, d) {
//将传入的参数转换成字符串,作比较
var Y = y.toString();
var M = m < 10 ? ‘0‘ +