Skip to content

Commit

Permalink
fix(taro-weapp/qq/tt/alipay): 修复 $componentType 错误,fix #4123
Browse files Browse the repository at this point in the history
修复“实现了 componentWillPreload 的页面 $componentType 的值错误”
  • Loading branch information
Chen-jj committed Aug 12, 2019
1 parent 5bb14fb commit a6e31b5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/taro-alipay/src/create-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
1 change: 1 addition & 0 deletions packages/taro-qq/src/create-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
1 change: 1 addition & 0 deletions packages/taro-tt/src/create-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
1 change: 1 addition & 0 deletions packages/taro-weapp/src/create-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit a6e31b5

Please sign in to comment.