mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-12-29 22:39:15 +08:00
fix(form): 动态tab自定义onTabAdd后出错
This commit is contained in:
parent
2630f00f13
commit
9d4324dd6b
@ -26,8 +26,8 @@
|
|||||||
<span>
|
<span>
|
||||||
{{ filter(tab.title)
|
{{ filter(tab.title)
|
||||||
}}<TMagicBadge
|
}}<TMagicBadge
|
||||||
:hidden="!diffCount[tabIndex]"
|
:hidden="!diffCount[Number(tabIndex)]"
|
||||||
:value="diffCount[tabIndex]"
|
:value="diffCount[Number(tabIndex)]"
|
||||||
class="diff-count-badge"
|
class="diff-count-badge"
|
||||||
></TMagicBadge>
|
></TMagicBadge>
|
||||||
</span>
|
</span>
|
||||||
@ -69,7 +69,7 @@
|
|||||||
:label-width="tab.labelWidth || labelWidth"
|
:label-width="tab.labelWidth || labelWidth"
|
||||||
:expand-more="expandMore"
|
:expand-more="expandMore"
|
||||||
@change="changeHandler"
|
@change="changeHandler"
|
||||||
@addDiffCount="onAddDiffCount(tabIndex)"
|
@addDiffCount="onAddDiffCount(Number(tabIndex))"
|
||||||
></Container>
|
></Container>
|
||||||
</component>
|
</component>
|
||||||
</component>
|
</component>
|
||||||
@ -195,7 +195,7 @@ const onTabAdd = async () => {
|
|||||||
prop: props.prop,
|
prop: props.prop,
|
||||||
config: props.config,
|
config: props.config,
|
||||||
});
|
});
|
||||||
emit('change', props.model);
|
emit('change', props.model[props.name]);
|
||||||
} else {
|
} else {
|
||||||
const newObj = await initValue(mForm, {
|
const newObj = await initValue(mForm, {
|
||||||
config: props.config.items,
|
config: props.config.items,
|
||||||
@ -237,12 +237,12 @@ const onTabRemove = (tabName: string) => {
|
|||||||
tabClick(mForm, { name: activeTabName.value }, props);
|
tabClick(mForm, { name: activeTabName.value }, props);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
emit('change', props.model);
|
emit('change', props.model[props.name]);
|
||||||
mForm?.$emit('field-change', props.prop, props.model[props.name]);
|
mForm?.$emit('field-change', props.prop, props.model[props.name]);
|
||||||
};
|
};
|
||||||
|
|
||||||
const changeHandler = (v: any, eventData: ContainerChangeEventData) => {
|
const changeHandler = (v: any, eventData: ContainerChangeEventData) => {
|
||||||
emit('change', props.model, eventData);
|
emit('change', props.name ? props.model[props.name] : props.model, eventData);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 在tabs组件中收集事件触发次数,即该tab下的差异数
|
// 在tabs组件中收集事件触发次数,即该tab下的差异数
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user