From 1e4bc6e105afc21d61e6bc17f525bbd3be107a91 Mon Sep 17 00:00:00 2001 From: DCloud_LXH <283700113@qq.com> Date: Wed, 16 Mar 2022 15:43:42 +0800 Subject: [PATCH] fix(mp-toutiao): resolve lifetimes error fix #3348 --- src/platforms/mp-weixin/runtime/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platforms/mp-weixin/runtime/index.js b/src/platforms/mp-weixin/runtime/index.js index 3c4204ae8..ed11b5f93 100644 --- a/src/platforms/mp-weixin/runtime/index.js +++ b/src/platforms/mp-weixin/runtime/index.js @@ -28,7 +28,7 @@ function initTriggerEvent (mpInstance) { function initHook (name, options, isComponent) { if (__PLATFORM__ === 'mp-toutiao') { // fix by Lxh 字节自定义组件Component构造器文档上写有created,但是实测只触发了lifetimes上的created - isComponent && (options = options.lifetimes) + isComponent && options.lifetimes && options.lifetimes[name] && (options = options.lifetimes) } const oldHook = options[name] if (!oldHook) { -- GitLab