hookehuyr

fix 模拟日期选择控件最大最小日期控制

1 <!-- 1 <!--
2 * @Date: 2022-08-31 11:45:30 2 * @Date: 2022-08-31 11:45:30
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2023-02-07 14:06:11 4 + * @LastEditTime: 2023-02-07 14:13:48
5 * @FilePath: /data-table/src/components/DatePickerField/index.vue 5 * @FilePath: /data-table/src/components/DatePickerField/index.vue
6 * @Description: 日期选择组件 6 * @Description: 日期选择组件
7 --> 7 -->
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
27 <van-date-picker 27 <van-date-picker
28 v-model="currentDate" 28 v-model="currentDate"
29 title="日期选择" 29 title="日期选择"
30 + :min-date="minDate"
31 + :max-date="maxDate"
30 :columns-type="columns_type" 32 :columns-type="columns_type"
31 @confirm="onConfirm" 33 @confirm="onConfirm"
32 @cancel="showPicker = false" 34 @cancel="showPicker = false"
...@@ -41,6 +43,11 @@ import dayjs from "dayjs"; ...@@ -41,6 +43,11 @@ import dayjs from "dayjs";
41 const props = defineProps({ 43 const props = defineProps({
42 item: Object, 44 item: Object,
43 }); 45 });
46 +
47 +// 默认最大可选日期/最小可选日期
48 +// const minDate = ref(new Date(2020, 0, 1))
49 +// const maxDate = ref(new Date(2025, 5, 1))
50 +
44 // 隐藏显示 51 // 隐藏显示
45 const HideShow = computed(() => { 52 const HideShow = computed(() => {
46 return !props.item.component_props.disabled 53 return !props.item.component_props.disabled
......