mounted() {
this.$nextTick(() => {
//滚动距离 获取滚动的元素(overflow:auto;overflow:scroll)
let scrollWidth = this.$refs['mcalendar'].scrollWidth
//根据星期滚动到当前日期
let week = new Date().getDay()
if (week === 0) week = 7
this.$refs['mcalendar'].scrollLeft = ((week - 1) / 7) * scrollWidth
})
},
网友评论