complex-plugin
Advanced tools
+3
-0
| ### ToDo | ||
| ### 4.9.2 | ||
| - feat:PluginLayoutData添加visible属性及相关逻辑 | ||
| ### 4.9.1 | ||
@@ -4,0 +7,0 @@ - feat:修改模块加载逻辑为ES2020 |
+1
-1
| { | ||
| "name": "complex-plugin", | ||
| "version": "4.9.1", | ||
| "version": "4.9.2", | ||
| "description": "a complex plugin", | ||
@@ -5,0 +5,0 @@ "type": "module", |
+19
-5
@@ -62,2 +62,3 @@ import { _Data, Life, throttle } from "complex-utils" | ||
| export interface PluginLayoutDataInitOption { | ||
| visible?: boolean | ||
| width?: number | ||
@@ -72,2 +73,3 @@ height?: number | ||
| static $formatConfig = { name: 'PluginLayoutData', level: 80, recommend: true } | ||
| visible: boolean | ||
| width: number | ||
@@ -78,2 +80,3 @@ height: number | ||
| constructor(initOption: PluginLayoutDataInitOption) { | ||
| this.visible = initOption.visible === undefined ? true : initOption.visible | ||
| this.width = initOption.width || 0 | ||
@@ -91,2 +94,11 @@ this.height = initOption.height || 0 | ||
| } | ||
| show() { | ||
| this.visible = true | ||
| } | ||
| hide() { | ||
| this.visible = false | ||
| } | ||
| toggle() { | ||
| this.visible = !this.visible | ||
| } | ||
| change(width: number, height: number) { | ||
@@ -102,8 +114,10 @@ if (this.width !== width || this.height !== height) { | ||
| count(extraLayout: PluginLayoutData) { | ||
| if (this.width) { | ||
| extraLayout.width += this.width | ||
| if (this.visible) { | ||
| if (this.width) { | ||
| extraLayout.width += this.width | ||
| } | ||
| if (this.height) { | ||
| extraLayout.height += this.height | ||
| } | ||
| } | ||
| if (this.height) { | ||
| extraLayout.height += this.height | ||
| } | ||
| } | ||
@@ -110,0 +124,0 @@ } |
26331
1.45%531
2.71%