From 80cd4adad936798e79875a12dc161f0dc5ed9397 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Fri, 7 May 2021 16:06:33 +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?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.dev.js | 2 +- build.prod.js | 2 +- src/color/index.wc | 2 +- src/form/button.wc | 2 +- src/form/checkbox-item.wc | 2 +- src/form/checkbox.wc | 2 +- src/form/dropdown.wc | 2 +- src/form/input.wc | 2 +- src/form/link.wc | 2 +- src/form/number.wc | 2 +- src/form/option.wc | 2 +- src/form/passwd.wc | 2 +- src/form/radio-item.wc | 2 +- src/form/radio.wc | 2 +- src/form/select.wc | 2 +- src/form/switch.wc | 2 +- src/form/textarea.wc | 2 +- src/layer/index.wc | 2 +- src/markd/index.wc | 2 +- src/meditor/index.wc | 2 +- src/neditor/index.wc | 2 +- src/picker/date.wc | 2 +- src/scroll/index.wc | 20 +++++++++++++++----- src/slider/index.wc | 2 +- 24 files changed, 38 insertions(+), 28 deletions(-) diff --git a/build.dev.js b/build.dev.js index 45ad9db..9211c73 100644 --- a/build.dev.js +++ b/build.dev.js @@ -96,7 +96,7 @@ function mkWCFile({ style, html, js }) { ` ) .replace('mounted()', 'connectedCallback()') - .replace('unmount()', 'disconnectedCallback()') + .replace('unmounted()', 'disconnectedCallback()') .replace( 'watch() {', 'attributeChangedCallback(name, old, val) {\nif (old === val) {return}' diff --git a/build.prod.js b/build.prod.js index 5baab49..220860c 100644 --- a/build.prod.js +++ b/build.prod.js @@ -111,7 +111,7 @@ function mkWCFile({ style, html, js }) { ` ) .replace('mounted()', 'connectedCallback()') - .replace('unmount()', 'disconnectedCallback()') + .replace('unmounted()', 'disconnectedCallback()') .replace( 'watch() {', 'attributeChangedCallback(name, old, val) {\nif (old === val) {return}' diff --git a/src/color/index.wc b/src/color/index.wc index 9fa4231..510784e 100644 --- a/src/color/index.wc +++ b/src/color/index.wc @@ -521,7 +521,7 @@ export default class Color { }) } - unmount() { + unmounted() { $.unbind(this.__SCENE__, 'mousedown', this.handleDown) $.unbind(document, 'mousedown', this.handleUp) $.unbind(this.__HUE__, 'input', this.handleInput1) diff --git a/src/form/button.wc b/src/form/button.wc index 15be3a1..6467e96 100644 --- a/src/form/button.wc +++ b/src/form/button.wc @@ -356,7 +356,7 @@ export default class Button { }) } - unmount() { + unmounted() { $.unbind(this.__BTN__, 'click', this._handleClick) } diff --git a/src/form/checkbox-item.wc b/src/form/checkbox-item.wc index 8ea670e..f69e5bb 100644 --- a/src/form/checkbox-item.wc +++ b/src/form/checkbox-item.wc @@ -265,7 +265,7 @@ export default class Checkbox { }) } - unmount() { + unmounted() { $.unbind(this, 'click', this._handlClick) $.unbind(this, 'keydown', this._handlKeydown) } diff --git a/src/form/checkbox.wc b/src/form/checkbox.wc index 4bd82d3..1fd1f7c 100644 --- a/src/form/checkbox.wc +++ b/src/form/checkbox.wc @@ -119,7 +119,7 @@ export default class CheckboxGroup { }) } - unmount() { + unmounted() { $.unbind(this, 'child-picked', this._pickedFn) this.__observer.disconnect() } diff --git a/src/form/dropdown.wc b/src/form/dropdown.wc index c185c13..0764ad6 100644 --- a/src/form/dropdown.wc +++ b/src/form/dropdown.wc @@ -243,7 +243,7 @@ export default class Dropdown { }) } - unmount() { + unmounted() { this.state.options = [] $.unbind(this.__PREVIEW__, 'click', this._activeFn) $.unbind(this.__OPTIONS__, 'click', this._pickedFn) diff --git a/src/form/input.wc b/src/form/input.wc index 8db13a8..b6091fd 100644 --- a/src/form/input.wc +++ b/src/form/input.wc @@ -583,7 +583,7 @@ export default class Input { }) } - unmount() { + unmounted() { $.unbind(this.__INPUT__, 'keydown', this._handleSubmit) $.unbind(this.__INPUT__, 'input', this._handleChange) $.unbind(this.__INPUT__, 'click', this._parseSuggestion) diff --git a/src/form/link.wc b/src/form/link.wc index b8e0b5e..ca329e3 100644 --- a/src/form/link.wc +++ b/src/form/link.wc @@ -251,7 +251,7 @@ export default class Link { }) } - unmount() { + unmounted() { $.unbind(this.__LINK__, 'click', this._handleClick) } diff --git a/src/form/number.wc b/src/form/number.wc index fda9d78..5506c61 100644 --- a/src/form/number.wc +++ b/src/form/number.wc @@ -385,7 +385,7 @@ export default class Number { }) } - unmount() { + unmounted() { $.unbind(this.__INPUT__, 'keydown', this._handleSubmit) $.unbind(this.__OUTER__, 'click', this._handleAction) } diff --git a/src/form/option.wc b/src/form/option.wc index 7928741..1c767ec 100644 --- a/src/form/option.wc +++ b/src/form/option.wc @@ -111,7 +111,7 @@ export default class Option { }) } - unmount() { + unmounted() { $.unbind(this, 'click', this._clickFn) } diff --git a/src/form/passwd.wc b/src/form/passwd.wc index 0d7bd78..ee15fab 100644 --- a/src/form/passwd.wc +++ b/src/form/passwd.wc @@ -412,7 +412,7 @@ export default class Passwd { }) } - unmount() { + unmounted() { $.unbind(this.__INPUT__, 'keydown', this._handleSubmit) $.unbind(this.__EYE__, 'click', this._eyeFn) } diff --git a/src/form/radio-item.wc b/src/form/radio-item.wc index 0f20494..aca1139 100644 --- a/src/form/radio-item.wc +++ b/src/form/radio-item.wc @@ -251,7 +251,7 @@ export default class Radio { }) } - unmount() { + unmounted() { $.unbind(this, 'click', this._handleClick) $.unbind(this, 'keydown', this._handlKeydown) } diff --git a/src/form/radio.wc b/src/form/radio.wc index 8515be1..fd15939 100644 --- a/src/form/radio.wc +++ b/src/form/radio.wc @@ -108,7 +108,7 @@ export default class RadioGroup { }) } - unmount() { + unmounted() { $.unbind(this, 'child-picked', this._pickedFn) this.__observer.disconnect() } diff --git a/src/form/select.wc b/src/form/select.wc index bafec4a..e98e427 100644 --- a/src/form/select.wc +++ b/src/form/select.wc @@ -499,7 +499,7 @@ export default class Select { } } - unmount() { + unmounted() { $.unbind(this.__INPUT__, 'keydown', this._handleKeydown) $.unbind(this.__INPUT__, 'click', this._activeFn) $.unbind(this.__OPTG__, 'click', this._handleSelect) diff --git a/src/form/switch.wc b/src/form/switch.wc index dc5e9ac..1e51a8c 100644 --- a/src/form/switch.wc +++ b/src/form/switch.wc @@ -181,7 +181,7 @@ export default class Switch { }) } - unmount() { + unmounted() { $.unbind(this, 'click', this._handleClick) } diff --git a/src/form/textarea.wc b/src/form/textarea.wc index 6889b8e..5b769f7 100644 --- a/src/form/textarea.wc +++ b/src/form/textarea.wc @@ -247,7 +247,7 @@ export default class Textarea { }) } - unmount() { + unmounted() { $.unbind(this.__INPUT__, 'keydown', this._handleSubmit) $.unbind(this.__INPUT__, 'input,change', this._statFn) } diff --git a/src/layer/index.wc b/src/layer/index.wc index 99f76d4..febc102 100644 --- a/src/layer/index.wc +++ b/src/layer/index.wc @@ -586,7 +586,7 @@ export default class Layer { } } - unmount() { + unmounted() { $.clearOutside(this._handlMask) $.unbind(this.__TITLE__, 'click', this._handleClose) $.unbind(this.__CTRL__, 'click', this._handleBtnClick) diff --git a/src/markd/index.wc b/src/markd/index.wc index d2f39de..a00e0eb 100644 --- a/src/markd/index.wc +++ b/src/markd/index.wc @@ -237,7 +237,7 @@ export default class Markd { }) } - unmount() { + unmounted() { $.unbind(this.__BOX__, 'click', this._headClickFn) this.__observer.disconnect() this.clear() diff --git a/src/meditor/index.wc b/src/meditor/index.wc index 3ab1ccd..eecad33 100644 --- a/src/meditor/index.wc +++ b/src/meditor/index.wc @@ -1005,7 +1005,7 @@ export default class Meditor { }) } - unmount() { + unmounted() { $.unbind(this.__EDITOR__, 'input', this._inputFn) $.unbind(this.__EDITOR__, 'keydown', this._keydownFn) $.unbind(this.__EDITOR__, 'paste', this._pasteFn) diff --git a/src/neditor/index.wc b/src/neditor/index.wc index 8097601..ae4b1c4 100644 --- a/src/neditor/index.wc +++ b/src/neditor/index.wc @@ -602,7 +602,7 @@ export default class Neditor { }) } - unmount() { + unmounted() { $.unbind(this.__TOOLBAR__, 'click', this.__toolFn) $.unbind(this.__FONT__, 'click', this.__fontFn) $.unbind(this.__COLOR__, 'click', this.__colorFn) diff --git a/src/picker/date.wc b/src/picker/date.wc index 6bb1f13..adc36a5 100644 --- a/src/picker/date.wc +++ b/src/picker/date.wc @@ -628,7 +628,7 @@ export default class DatePicker { }) } - unmount() { + unmounted() { $.unbind(this.__INPUT__, 'click', this._activeFn) $.unbind(this.__DAYS__, 'click', this._pickFn) $.unbind(this.__CTRL__, 'click', this._ctrlFn) diff --git a/src/scroll/index.wc b/src/scroll/index.wc index a5e4b1e..c6d57ce 100644 --- a/src/scroll/index.wc +++ b/src/scroll/index.wc @@ -125,14 +125,14 @@