vue3 ant DatePicker时间组件 TypeError: date4.locale is not a function

vue3 ant DatePicker时间组件 TypeError: date4.locale is not a function

// table组件内 可编辑时间
<template v-if="['shippingDate', 'demandDate'].includes(column.dataIndex)">
   <a-date-picker              
     v-model:value="record[column.dataIndex]"
     :format="YYYY-MM-DD"
     style="width: 100%"
     @change="changeBlur(record, column.dataIndex)"
   />
 </template>

解决方案 : 处理返回数据

import dayjs, {
    
     Dayjs } from 'dayjs';
// 返回数据处理
tableList.value.forEach(ele => ele.shippingDate = ele?.shippingDate && ref<Dayjs>(dayjs(ele.shippingDate), "YYYY-MM-DD"))

猜你喜欢

转载自blog.csdn.net/MoXinXueWEB/article/details/131386702