@@ -89,6 +89,7 @@ export class BaseComponent {
89
89
const allData = getObjSubData ( this . _r )
90
90
const wxInst = instanceManager . getWxInstByUUID ( diuu )
91
91
92
+ console . log ( 'first wow:' , allData , this )
92
93
if ( Object . keys ( allData ) . length === 0 ) {
93
94
recursionMount ( this )
94
95
} else {
@@ -123,6 +124,7 @@ export class BaseComponent {
123
124
const topWX = styleUpdater ? styleUpdater . inst : this . getWxInst ( )
124
125
let hasGprAdd = false
125
126
topWX . groupSetData ( ( ) => {
127
+ console . log ( 'update wow:' , updaterList )
126
128
for ( let i = 0 ; i < updaterList . length ; i ++ ) {
127
129
const { inst, data} = updaterList [ i ]
128
130
if ( ! hasGprAdd ) {
@@ -147,19 +149,17 @@ export class BaseComponent {
147
149
*/
148
150
updateWXInner ( doneCb , updaterList , groupPromise ) {
149
151
const updatePros = [ ]
152
+ const updateObj = { }
150
153
const children = this . _c
151
154
for ( let i = 0 ; i < children . length ; i ++ ) {
152
155
const childUuid = children [ i ]
153
156
const child = instanceManager . getCompInstByUUID ( childUuid )
154
157
155
158
if ( child . firstRender !== FR_DONE && child . hocWrapped ) {
156
- /**
157
- * 如果child 是由hoc包裹,由于hoc包裹的组件,并不直接对应微信实例,所以无法通过微信的ready的声明周期来执行
158
- * firstRender。不过此时微信小程序实例已经存在,所以可以直接调用setData方法
159
- */
160
159
const allSubData = getObjSubData ( child . _r )
161
160
const wxInst = child . getWxInst ( )
162
161
162
+ // HOC 多次嵌套的情况,allSubData可能是{}
163
163
if ( Object . keys ( allSubData ) . length === 0 ) {
164
164
recursionMount ( child )
165
165
updatePros . push ( P_R )
@@ -180,9 +180,13 @@ export class BaseComponent {
180
180
updatePros . push ( p )
181
181
}
182
182
} else if ( child . firstRender !== FR_DONE && ! child . hocWrapped ) {
183
- // 新增普通节点,通过微信的ready 生命周期 触发firstRender
184
- const p = new Promise ( ( resolve ) => {
185
- child . firstRenderRes = resolve
183
+ updateObj [ `${ child . _keyPath } R` ] = getObjSubData ( child . _r )
184
+
185
+ const p = new Promise ( resolve => {
186
+ groupPromise . then ( ( ) => {
187
+ recursionMount ( child )
188
+ resolve ( )
189
+ } )
186
190
} )
187
191
updatePros . push ( p )
188
192
} else if ( child . shouldUpdate ) {
@@ -209,6 +213,7 @@ export class BaseComponent {
209
213
210
214
211
215
const cp = getChangePath ( this . _r , this . _or )
216
+ Object . assign ( cp , updateObj )
212
217
if ( Object . keys ( cp ) . length === 0 ) {
213
218
updatePros . push ( P_R )
214
219
} else {
@@ -361,7 +366,7 @@ export class Component extends BaseComponent {
361
366
while ( true ) {
362
367
const pp = p . _p
363
368
if ( pp . isPageComp || ! p . _isFirstEle ) {
364
- const stylePath = p . _stylePath
369
+ const stylePath = ` ${ p . _keyPath } style`
365
370
setDeepData ( pp , newOutStyle , stylePath )
366
371
367
372
const diuu = pp . __diuu__
0 commit comments