hookehuyr

fix

<!--
* @Date: 2022-08-31 11:45:30
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-06-13 14:30:42
* @LastEditTime: 2024-06-13 15:54:10
* @FilePath: /data-table/src/components/DatePickerField/index.vue
* @Description: 日期选择组件
-->
......@@ -76,7 +76,7 @@ const maxDate = ref()
onMounted(() => {
// 根据默认值时间调整显示
props.item.value = props.item.component_props.default;
currentDate.value = props.item.component_props.default ? props.item.component_props.default.split("-") : props.item.value.split("-");
currentDate.value = props.item.component_props.default ? props.item.component_props.default.split("-") : props.item.value?.split("-");
let Year = '';
let Month = '';
let Day = '';
......
<!--
* @Date: 2022-09-08 15:02:45
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-06-13 14:32:20
* @LastEditTime: 2024-06-13 15:56:40
* @FilePath: /data-table/src/components/DateTimePickerField/index.vue
* @Description: 日期时间选择器
-->
......@@ -82,7 +82,7 @@ const maxDate = ref()
onMounted(() => {
// 根据默认值时间调整显示
props.item.value = props.item.component_props.default;
const datetime = props.item.component_props.default ? props.item.component_props.default.split(" ") : props.item.value.split(" ");
const datetime = props.item.component_props.default ? props.item.component_props.default.split(" ") : props.item.value?.split(" ");
currentDate.value = datetime[0]?.split("-");
currentTime.value = datetime[1]?.split(":");
// YYYY=年,YYYY-MM=年月,YYYY-MM-DD=年月日,YYYY-MM-DD HH=年月日时,YYYY-MM-DD HH:mm=年月日时分,YYYY-MM-DD HH:mm:ss=年月日时分秒
......
<!--
* @Date: 2022-08-31 11:45:30
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-06-13 14:33:24
* @LastEditTime: 2024-06-13 15:54:33
* @FilePath: /data-table/src/components/TimePickerField/index.vue
* @Description: 时间选择组件
-->
......@@ -63,7 +63,7 @@ const date_format = props.item.component_props.data_dateformat; // HH:mm=时分ï
onMounted(() => {
// 根据默认值时间调整显示
props.item.value = props.item.component_props.default;
currentTime.value = props.item.component_props.default ? props.item.component_props.default.split(":") : props.item.value.split(":");
currentTime.value = props.item.component_props.default ? props.item.component_props.default.split(":") : props.item.value?.split(":");
let Hour = ''
let Minute = ''
let Second = ''
......