tiny-vue/examples/docs/resources/pc/demo/date-picker/date-range.vue

36 lines
810 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div>
<p>日期值{{ value }}</p>
<tiny-date-picker v-model="value" type="daterange" :picker-options="onPickOptions"></tiny-date-picker>
</div>
</template>
<script lang="jsx">
import { DatePicker, Modal } from '@opentiny/vue'
export default {
components: {
TinyDatePicker: DatePicker
},
data() {
return {
value: [new Date(), new Date(2019, 12, 12)],
onPickOptions: {
onPick: (val) => {
if (val.maxDate) {
Modal.message({
message: '当前获取的值 maxDate' + val.maxDate,
status: 'info'
})
Modal.message({
message: '当前获取的值 minDate' + val.minDate,
status: 'info'
})
}
}
}
}
}
}
</script>