From e42e6de4cd99c48209764a1195a7bee830369fb8 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 5 Mar 2021 16:25:04 +0800 Subject: [PATCH] =?UTF-8?q?mounted=E6=94=BE=E5=88=B0=E4=B8=8B=E4=B8=AA?= =?UTF-8?q?=E5=AE=8F=E4=BB=BB=E5=8A=A1=E9=87=8C=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/widget.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/widget.js b/src/core/widget.js index 4b5b0741a..ad8ac20e2 100644 --- a/src/core/widget.js +++ b/src/core/widget.js @@ -254,8 +254,10 @@ } this._mountChildren && this._mountChildren(); if (layer === 0) { - // 最后再统一执行生命周期 - this.__afterMount(lifeHook, predicate); + // mounted放到下一个宏任务里执行 + setTimeout(function () { + self.__afterMount(lifeHook, predicate); + }, 0); } return true; },