mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-05 19:41:40 +08:00
fix(form): daterange 错误信息不会消除
This commit is contained in:
parent
d97e265444
commit
a90777f11a
@ -32,7 +32,7 @@
|
||||
<template v-else-if="type && display">
|
||||
<el-form-item
|
||||
:style="config.tip ? 'flex: 1' : ''"
|
||||
:class="{ hidden: itemLabelWidth === 0 || !config.text }"
|
||||
:class="{ hidden: `${itemLabelWidth}` === '0' || !config.text }"
|
||||
:prop="itemProp"
|
||||
:label-width="itemLabelWidth"
|
||||
:rules="rule"
|
||||
@ -154,7 +154,18 @@ export default defineComponent({
|
||||
|
||||
const items = computed(() => (props.config as ContainerCommonConfig).items);
|
||||
|
||||
const itemProp = computed(() => (name.value ? `${props.prop}${props.prop ? '.' : ''}${name.value}` : props.prop));
|
||||
const itemProp = computed(() => {
|
||||
let n: string | number = '';
|
||||
const { names } = props.config as any;
|
||||
if (names?.[0]) {
|
||||
[n] = names;
|
||||
} else if (name.value) {
|
||||
n = name.value;
|
||||
} else {
|
||||
return props.prop;
|
||||
}
|
||||
return `${props.prop}${props.prop ? '.' : ''}${n}`;
|
||||
});
|
||||
|
||||
const tagName = computed(() => {
|
||||
const component = resolveComponent(`m-${items.value ? 'form' : 'fields'}-${type.value}`);
|
||||
|
@ -60,6 +60,14 @@ export default defineComponent({
|
||||
});
|
||||
} else if (props.model && props.name && v instanceof Date) {
|
||||
props.model[props.name] = datetimeFormatter(v.toString(), '');
|
||||
} else if (names?.length) {
|
||||
names.forEach((item) => {
|
||||
if (props.model) {
|
||||
props.model[item] = undefined;
|
||||
}
|
||||
});
|
||||
} else if (props.name) {
|
||||
props.model[props.name] = undefined;
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user