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