From a6e31b5c1304d773c9cd3b45dad63844839746d9 Mon Sep 17 00:00:00 2001 From: chenjiajian <798095202@qq.com> Date: Mon, 12 Aug 2019 21:40:19 +0800 Subject: [PATCH] =?UTF-8?q?fix(taro-weapp/qq/tt/alipay):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=20$componentType=20=E9=94=99=E8=AF=AF=EF=BC=8Cfix=20#?= =?UTF-8?q?4123?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复“实现了 componentWillPreload 的页面 $componentType 的值错误” --- packages/taro-alipay/src/create-component.js | 1 + packages/taro-qq/src/create-component.js | 1 + packages/taro-tt/src/create-component.js | 1 + packages/taro-weapp/src/create-component.js | 1 + 4 files changed, 4 insertions(+) diff --git a/packages/taro-alipay/src/create-component.js b/packages/taro-alipay/src/create-component.js index aca9e8e7e834..b90b259dff59 100644 --- a/packages/taro-alipay/src/create-component.js +++ b/packages/taro-alipay/src/create-component.js @@ -247,6 +247,7 @@ function createComponent (ComponentClass, isPage) { hasPageInited = false if (cacheDataHas(preloadInitedComponent)) { this.$component = cacheDataGet(preloadInitedComponent, true) + this.$component.$componentType = 'PAGE' } else { this.$component = new ComponentClass({}, isPage) } diff --git a/packages/taro-qq/src/create-component.js b/packages/taro-qq/src/create-component.js index 9c96bc7a920f..3ca9eacc9219 100644 --- a/packages/taro-qq/src/create-component.js +++ b/packages/taro-qq/src/create-component.js @@ -295,6 +295,7 @@ function createComponent (ComponentClass, isPage) { created (options = {}) { if (isPage && cacheDataHas(preloadInitedComponent)) { this.$component = cacheDataGet(preloadInitedComponent, true) + this.$component.$componentType = 'PAGE' } else { this.$component = new ComponentClass({}, isPage) } diff --git a/packages/taro-tt/src/create-component.js b/packages/taro-tt/src/create-component.js index b5722939545c..6305a743809b 100644 --- a/packages/taro-tt/src/create-component.js +++ b/packages/taro-tt/src/create-component.js @@ -292,6 +292,7 @@ function createComponent (ComponentClass, isPage) { isPage && (hasPageInited = false) if (isPage && cacheDataHas(preloadInitedComponent)) { this.$component = cacheDataGet(preloadInitedComponent, true) + this.$component.$componentType = 'PAGE' } else { this.$component = new ComponentClass({}, isPage) } diff --git a/packages/taro-weapp/src/create-component.js b/packages/taro-weapp/src/create-component.js index 1f993414fe70..c6e762e8d4cf 100644 --- a/packages/taro-weapp/src/create-component.js +++ b/packages/taro-weapp/src/create-component.js @@ -318,6 +318,7 @@ function createComponent (ComponentClass, isPage) { created (options = {}) { if (isPage && cacheDataHas(preloadInitedComponent)) { this.$component = cacheDataGet(preloadInitedComponent, true) + this.$component.$componentType = 'PAGE' } else { this.$component = new ComponentClass({}, isPage) }