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