From 00e81bf2c5ac16ec4c2d2c9be11c77e3fb58ab0b Mon Sep 17 00:00:00 2001 From: yutent Date: Fri, 22 Nov 2024 16:21:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BB=84=E4=BB=B6=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E6=97=B6,=20=E7=8A=B6=E6=80=81=E6=9C=AA=E4=BF=AE?= =?UTF-8?q?=E6=94=B9,=20=E5=8F=8A=E4=BA=8B=E4=BB=B6=E6=9C=AA=E6=B8=85?= =?UTF-8?q?=E7=A9=BA=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/index.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 1a41a8a..5882edf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wkit", - "version": "1.12.0", + "version": "1.12.1", "type": "module", "description": "A library for building fast, lightweight web components.", "main": "dist/index.js", diff --git a/src/index.js b/src/index.js index 566fd41..6984f93 100644 --- a/src/index.js +++ b/src/index.js @@ -295,6 +295,7 @@ export class Component extends HTMLElement { if (this.keepAlive) { nextTick(_ => this.deactivated()) } else { + this[__mounted__] = false if (!document.body?.contains(this)) { let $events = this.$events if ($events) { @@ -302,6 +303,7 @@ export class Component extends HTMLElement { for (let it of $events[name]) { unbind(it.el, name, it.listener, it.options) } + delete $events[name] } } this.removed = true