hookehuyr

fix 默认值为空判断

1 <!-- 1 <!--
2 * @Date: 2022-09-08 15:02:45 2 * @Date: 2022-09-08 15:02:45
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-06-13 17:53:14 4 + * @LastEditTime: 2024-06-13 18:22:45
5 * @FilePath: /data-table/src/components/DateTimePickerField/index.vue 5 * @FilePath: /data-table/src/components/DateTimePickerField/index.vue
6 * @Description: 日期时间选择器 6 * @Description: 日期时间选择器
7 --> 7 -->
...@@ -81,7 +81,7 @@ const maxDate = ref() ...@@ -81,7 +81,7 @@ const maxDate = ref()
81 81
82 onMounted(() => { 82 onMounted(() => {
83 // 根据默认值时间调整显示 83 // 根据默认值时间调整显示
84 - props.item.value = props.item.component_props.default; 84 + props.item.value = props.item.component_props.default ? props.item.component_props.default : '';
85 const datetime = props.item.component_props.default ? props.item.component_props.default.split(" ") : props.item.value?.split(" "); 85 const datetime = props.item.component_props.default ? props.item.component_props.default.split(" ") : props.item.value?.split(" ");
86 currentDate.value = datetime[0]?.split("-"); 86 currentDate.value = datetime[0]?.split("-");
87 currentTime.value = datetime[1]?.split(":"); 87 currentTime.value = datetime[1]?.split(":");
......