feat: 支持设置切换节点时, 设置区tab是否停留在原位置, 默认回到第一个

This commit is contained in:
lihao.ylh 2021-08-13 11:16:37 +08:00
parent a68eaf902f
commit 87b57ab4f1
2 changed files with 8 additions and 2 deletions

View File

@ -55,6 +55,10 @@ export interface EngineOptions {
* false
*/
enableCanvasLock: boolean;
/**
* tab false
*/
stayOnTheSameSettingTab: boolean;
/**
* Vision-polyfill settings
*/

View File

@ -1,6 +1,6 @@
import React, { Component } from 'react';
import { Tab, Breadcrumb } from '@alifd/next';
import { Title, observer, Editor, obx, globalContext } from '@ali/lowcode-editor-core';
import { Title, observer, Editor, obx, globalContext, engineConfig } from '@ali/lowcode-editor-core';
import { Node, isSettingField, SettingField, Designer } from '@ali/lowcode-designer';
import { SettingsMain } from './main';
import { SettingsPane } from './settings-pane';
@ -24,7 +24,9 @@ export class SettingsPrimaryPane extends Component<{ editor: Editor; config: any
this.setShouldIgnoreRoot();
this.props.editor.on('designer.selection.change', () => {
this._activeKey = null;
if (!engineConfig.get('stayOnTheSameSettingTab', false)) {
this._activeKey = null;
}
});
}