mirror of
https://gitee.com/hoslay/ddei-editor.git
synced 2025-12-07 17:48:32 +08:00
50 lines
1.1 KiB
TypeScript
50 lines
1.1 KiB
TypeScript
import {DDeiPluginBase} from "ddei-framework";
|
||
import Tool from './Tool.vue';
|
||
|
||
class DDeiCoreToolPanel extends DDeiPluginBase{
|
||
|
||
name: string = Tool.name
|
||
|
||
|
||
/**
|
||
* 缺省实例
|
||
*/
|
||
static defaultIns: DDeiCoreToolPanel = new DDeiCoreToolPanel(null);
|
||
|
||
|
||
plugins: object[] = [Tool]
|
||
|
||
getPanels(editor){
|
||
return this.plugins;
|
||
}
|
||
|
||
|
||
static configuration(options, fullConfig: boolean = false) {
|
||
//解析options,只使用自己相关的
|
||
if (options) {
|
||
let newOptions = {}
|
||
if (fullConfig) {
|
||
if (fullConfig) {
|
||
if (options[Tool.name]) {
|
||
for (let i in options[Tool.name]) {
|
||
newOptions[i] = options[Tool.name][i]
|
||
}
|
||
}
|
||
}
|
||
} else {
|
||
newOptions = options
|
||
}
|
||
if (newOptions && Object.keys(newOptions).length !== 0) {
|
||
let panels = new DDeiCoreToolPanel(newOptions);
|
||
return panels;
|
||
}
|
||
}
|
||
return DDeiCoreToolPanel;
|
||
}
|
||
|
||
static modify(fn) {
|
||
return DDeiCoreToolPanel.defaultIns.modify(fn)
|
||
}
|
||
}
|
||
|
||
export default DDeiCoreToolPanel |