mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2026-06-04 02:54:20 +08:00
fix(form): 对比模式下无 name 字段时不展示差异
避免 name 为空时拿整个 model/lastValues 做对比导致误判 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
35fc394199
commit
64d35d5363
@ -307,8 +307,10 @@ const name = computed(() => props.config.name || '');
|
||||
// 便于业务侧自定义"语义上相等"的特殊场景(例如空字符串与空 hook 结构)。
|
||||
const showDiff = computed(() => {
|
||||
if (!props.isCompare) return false;
|
||||
const curValue = name.value ? props.model[name.value] : props.model;
|
||||
const lastValue = name.value ? props.lastValues[name.value] : props.lastValues;
|
||||
if (!name.value) return false;
|
||||
|
||||
const curValue = props.model[name.value];
|
||||
const lastValue = props.lastValues[name.value];
|
||||
|
||||
const customShowDiff = diffConfig.showDiff;
|
||||
if (typeof customShowDiff === 'function') {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user