mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2026-07-04 07:44:02 +08:00
fix(editor): 数据源配置面板默认激活「数据定义」tab
未指定编辑方法或字段路径时,将 tab 容器默认激活到 fields,避免无 active 状态。
This commit is contained in:
parent
8933c46b73
commit
95769d6ae0
@ -83,16 +83,17 @@ watchEffect(() => {
|
||||
const config = dataSourceService.getFormConfig(initValues.value.type);
|
||||
|
||||
// 传入方法名/字段路径时,将外层 tab 容器默认激活到对应 tab(status: methods / fields)
|
||||
let activeTab = '';
|
||||
// 未传入时默认激活「数据定义」tab(fields)
|
||||
let activeTab = 'fields';
|
||||
if (props.editMethodName) {
|
||||
activeTab = 'methods';
|
||||
} else if (props.editFieldPath?.length) {
|
||||
activeTab = 'fields';
|
||||
}
|
||||
|
||||
dataSourceConfig.value = activeTab
|
||||
? config.map((item) => ((item as { type?: string }).type === 'tab' ? { ...item, active: activeTab } : item))
|
||||
: config;
|
||||
dataSourceConfig.value = config.map((item) =>
|
||||
(item as { type?: string }).type === 'tab' ? { ...item, active: activeTab } : item,
|
||||
);
|
||||
});
|
||||
|
||||
const submitHandler = (values: any, data: ContainerChangeEventData) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user