fix: 图片或附加文件字段点击清除后自动保存

This commit is contained in:
jingrow 2026-05-19 05:19:44 +08:00
parent 718a9cb8b4
commit 66677e1a5c
2 changed files with 14 additions and 0 deletions

View File

@ -68,6 +68,13 @@ async function onChange(e: Event) {
function clearValue() {
if (!props.canEdit) return
;(props.record as any)[props.df.fieldname] = ''
try {
if (typeof props.ctx?.save === 'function') {
props.ctx.save()
}
} catch (_err) {
// ignore autosave failures
}
}
</script>

View File

@ -64,6 +64,13 @@ async function onChange(e: Event) {
function clearValue() {
if (!props.canEdit) return
;(props.record as any)[props.df.fieldname] = ''
try {
if (typeof props.ctx?.save === 'function') {
props.ctx.save()
}
} catch (_err) {
// ignore autosave failures
}
}
</script>