标签:ring 定义 扩展 ref .sh sunday 数据传输 ber htm
今天给大家介绍Vue的日历组件,可自定义样式、日历类型及支持扩展,可自定义事件回调、Props数据传输。
Template:
<Calendar :sundayStart="true" :calendarType="1" :markDate="markDate" :markDateClass="markDateClass" :agoDayPrevent="agoDayPrevent" :futureDayPrevent="futureDayPrevent" @choseDay="choseDay" @changeMonth="changeMonth"> </Calendar>
script:
data() { return{ calendarClass: ‘cal_common‘, chooseDate: ‘‘, showCalendar: 1, markDate: [‘2019/02/13‘,‘2019/02/22‘], markDateClass: [ {date:‘2019/02/20‘,className:"mark1"}, {date:‘2018/02/21‘,className:"mark2"} ], agoDayPrevent: ‘1549728000‘, futureDayPrevent: ‘2551024000‘, } }, methods: { choseDay(date) { this.chooseDate = date }, toggleCal(type) { this.showCalendar = type }, changeMonth(date) { console.log(‘changeMonth‘+date) } }
Props属性
Event回调
data数据
标签:ring 定义 扩展 ref .sh sunday 数据传输 ber htm
原文地址:https://www.cnblogs.com/lodadssd/p/10450059.html