<template>
<div class="test-container">
<h2 class="sub-title">日历单选</h2>
<calendar v-model="value" />
<button @click="alert('value')" class="test-btn">确定</button>
<h2 class="sub-title">日历多选</h2>
<calendar v-model="value2" mode="multiple" />
<button @click="alert('value2')" class="test-btn">确定</button>
<h2 class="sub-title">日历区间</h2>
<calendar v-model="value3" mode="range" />
<button @click="alert('value3')" class="test-btn">确定</button>
<h2 class="sub-title">日历picker</h2>
<calendar-picker v-model="value3" mode="range" />
<button @click="alert('value3')" class="test-btn">确定</button>
</div>
</template>
<script>
import { Calendar, CalendarPicker } from 'kuan-vue-calendar'
export default {
components: {
Calendar,
CalendarPicker
},
data() {
return {
value: '2019-07-21',
value2: ['2019-07-09', '2019-07-20'],
value3: ['2019-07-09', '2019-07-20']
}
},
methods: {
alert(key) {
alert(JSON.stringify(this[key]))
}
}
}
</script>