From d47c6e5c1312701f08bc793156a69d49c29c3840 Mon Sep 17 00:00:00 2001 From: chenjiajian <770230504@qq.com> Date: Fri, 28 Apr 2023 18:49:30 +0800 Subject: [PATCH] update --- src/collapse/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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() {