From 17ce8fe6fae614849d4daa65f6ccd91921eac51a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Fri, 7 May 2021 20:37:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=BB=9A=E5=8A=A8=E7=BB=84?= =?UTF-8?q?=E4=BB=B6;=E4=B8=8B=E6=8B=89=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/form/dropdown.wc | 2 ++ src/form/option.wc | 6 +++++- src/markd/index.wc | 4 +++- src/scroll/index.wc | 3 +-- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/form/dropdown.wc b/src/form/dropdown.wc index 0764ad6..1476a86 100644 --- a/src/form/dropdown.wc +++ b/src/form/dropdown.wc @@ -241,6 +241,8 @@ export default class Dropdown { this.state.optionShow = false this.__OPTIONS__.classList.toggle('active', false) }) + + $.nextTick(_ => this._updateChildrenStat()) } unmounted() { diff --git a/src/form/option.wc b/src/form/option.wc index 1c767ec..1f35d17 100644 --- a/src/form/option.wc +++ b/src/form/option.wc @@ -119,7 +119,11 @@ export default class Option { switch (name) { case 'value': case 'label': - this[name] = val + if (val === null) { + this[name] = '' + } else { + this[name] = val + } break case 'disabled': diff --git a/src/markd/index.wc b/src/markd/index.wc index a00e0eb..34b0f18 100644 --- a/src/markd/index.wc +++ b/src/markd/index.wc @@ -209,7 +209,9 @@ export default class Markd { } else { this.__BOX__.innerHTML = '' } - this.dispatchEvent(new CustomEvent('ready', { bubbles: true })) + this.dispatchEvent( + new CustomEvent('ready', { bubbles: true, cancelable: true }) + ) } clear() { diff --git a/src/scroll/index.wc b/src/scroll/index.wc index c6d57ce..f46e04c 100644 --- a/src/scroll/index.wc +++ b/src/scroll/index.wc @@ -391,8 +391,7 @@ export default class Scroll { subtree: true, attributeFilter: ['style'] }) - - this._initFn(new Event('mounted')) + $.nextTick(_ => this._initFn(new Event('mounted'))) } unmounted() {