newVue({
el:'#app',
data: {//日历
currentYear: 2019,//lockYear:2019,//返回当前年
currentMonth: 1,//lockMonth:1,//返回当前月
currentDay: 1,//lockDay:1,//返回当前日
setDay:1,//取月份默认从一号开始取
currentWeek: 2,//周几
setWeek:1,
days: [],//每月天数
week_day:[],//每周天数
today_key:1,//取today所在week为第一个week_day
scroll:0,//滚动高度
dayScrollTop:0,//日历需要隐藏的高度
showMonth:true,//上下拉切换月和周
//日历滑动换月
startX:0,//触摸点
endX:0,//松开点
startY:0,
endY:0,//添加提醒设置时间
currentHour:0,
currentMinute:0,
getRemindTime:null,
eventId:1,//点击显示
show:false,
selectTime:false,//选项卡
tabtit: ["已设置提醒", "创建时间", "最后发言时间"],
tabmain: [new Array(), new Array(), newArray()],
num:0,
selectIndex:-1,
},
created() {this.initData(null);
},
watch: {//渲染完后,获取高度
days(){this.$nextTick(function(){/*console.log(this.$refs.daysBox.offsetHeight,this.$refs.daysBox.offsetTop);*/
var daysBoxHeight=this.$refs.daysBox.offsetHeight;var daysBoxHidden=daysBoxHeight/6*3;
var daysTop=this.$refs.daysBox.offsetTop;this.dayScrollTop=daysTop+daysBoxHidden;
});
},
},
methods: {
initData(cur) {vardate;if(cur) {
date= newDate(cur);
}else{
date= newDate();this.lockYear =date.getFullYear();this.lockMonth = date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1;this.lockDay = date.getDate() <10?'0'+date.getDate():date.getDate();
}this.currentDay = date.getDate() <10?'0'+date.getDate():date.getDate();//showMonth=f