-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
版本
@form-create/element-ui: 3.2.30
问题描述
在目前的业务中,后端返回时间格式为 YYYY-MM-DD, 保存是后端希望的时间格式为 YYYY/MM/DD。但是,目前虽然设置了valueFormat为YYYY/MM/DD,但如果不对:时间组件进行手动更改,则组件默认的 modalValue 仍会为 YYYY-MM-DD。即,默认的valueFormat逻辑并没有生效。而默认的 element-plus 组件是能够进行valueFormat转换。
期待效果
时间组件在挂载时就默认触发 valueFormat逻辑, 而不是仅仅在 change 时,才触发 valueFormat逻辑。
复现代码
const options = {
global: {
'datePicker': {
props: {
format: 'YYYY-MM-DD',
valueFormat: 'YYYY/MM/DD',
placeholder: '请选择',
},
}
}
}
const rule = [
{
title: '时间1',
type: 'datePicker',
field: 'time1',
props: {
type: 'date',
},
validate: [
{ required: true, message: '请选择时间', trigger: 'change' },
],
},
]Metadata
Metadata
Assignees
Labels
No labels