web:support hidden

This commit is contained in:
pengfei.zhou
2021-04-16 14:34:16 +08:00
committed by osborn
parent f3b4c2f077
commit 900bccb98a
4 changed files with 37 additions and 5 deletions

View File

@@ -103,6 +103,8 @@ export abstract class DoricViewNode {
view!: HTMLElement
_originDisplay: string = ""
transform: {
translateX?: number,
translateY?: number,
@@ -127,6 +129,7 @@ export abstract class DoricViewNode {
}
}
this.view = this.build()
this._originDisplay = this.view.style.display
}
abstract build(): HTMLElement
@@ -322,6 +325,13 @@ export abstract class DoricViewNode {
}
}
break
case 'hidden':
if (prop === true) {
this.view.style.display = "none"
} else {
this.view.style.display = this._originDisplay
}
break
default:
console.error(`Cannot blend prop for ${propName}`)
break