master
chenjiajian 2023-04-28 18:49:30 +08:00
parent 54e8243ec1
commit d47c6e5c13
1 changed files with 4 additions and 4 deletions

View File

@ -69,7 +69,7 @@ class CollapseItem extends Component {
title: '',
disabled: false
}
_show = false
#show = false
contentHeight = 0
static styles = [
css`
@ -122,17 +122,17 @@ class CollapseItem extends Component {
this.$emit('updateValue', { name: this.name })
}
get show() {
return this._show
return this.#show
}
set show(val) {
this._show = val
this.#show = val
this.contentHeight = this.$refs.content?.offsetHeight || 0
this.$requestUpdate()
}
mounted() {
nextTick(() => {
this.contentHeight = this.$refs.content.offsetHeight
this.$requestUpdate()
this.show && this.$requestUpdate()
})
}
render() {