diff --git a/src/collapse/index.js b/src/collapse/index.js index 62cff09..1fd9b6a 100644 --- a/src/collapse/index.js +++ b/src/collapse/index.js @@ -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() {