From 6f3ea0f0860a5f3aea0816d650bc1ae7767596f0 Mon Sep 17 00:00:00 2001 From: yutent Date: Fri, 11 Aug 2023 19:08:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0keepalive=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/index.js b/src/index.js index a3f373f..fa1562e 100644 --- a/src/index.js +++ b/src/index.js @@ -344,6 +344,9 @@ export class Component extends HTMLElement { if (this.$animate?.immediate) { this.$animate() } + if (this.__keep_alive__) { + this.activated() + } this.mounted() } else { this.updated(props) @@ -366,6 +369,8 @@ export class Component extends HTMLElement { // 几个生命周期回调 created() {} mounted() {} + activated() {} + deactivated() {} unmounted() {} updated() {} render() {