pawajs 1.4.1 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/normal/component.js +10 -2
- package/package.json +1 -1
package/normal/component.js
CHANGED
|
@@ -77,10 +77,12 @@ export const normal_component=(el,stateContext,setStateContext,mapsPlugin,former
|
|
|
77
77
|
}
|
|
78
78
|
const storeContext=stateContexts
|
|
79
79
|
let compo
|
|
80
|
+
let awaits=false
|
|
80
81
|
try {
|
|
81
82
|
if(done){
|
|
82
83
|
const compoCall=component.component(app)
|
|
83
84
|
if( compoCall instanceof Promise){
|
|
85
|
+
awaits=true
|
|
84
86
|
compoCall.then((res)=>{
|
|
85
87
|
div.innerHTML=res
|
|
86
88
|
propsSetter()
|
|
@@ -135,8 +137,11 @@ export const normal_component=(el,stateContext,setStateContext,mapsPlugin,former
|
|
|
135
137
|
console.error(error.message)
|
|
136
138
|
}
|
|
137
139
|
}
|
|
140
|
+
|
|
138
141
|
const childInsert=()=>{
|
|
142
|
+
console.log(el._component?._hook,el.tagName)
|
|
139
143
|
el._component?._hook?.beforeMount?.forEach((bfm) => {
|
|
144
|
+
bfm._sent=true
|
|
140
145
|
const result= bfm(comment)
|
|
141
146
|
if (typeof result === 'function') {
|
|
142
147
|
el._unMountFunctions.push(result)
|
|
@@ -144,9 +149,11 @@ export const normal_component=(el,stateContext,setStateContext,mapsPlugin,former
|
|
|
144
149
|
})
|
|
145
150
|
|
|
146
151
|
el._component?._hook?.isMount.forEach((hook) => {
|
|
152
|
+
hook._sent=true
|
|
147
153
|
el._MountFunctions.push(hook)
|
|
148
154
|
})
|
|
149
155
|
el._component?._hook?.isUnMount.forEach((hook) => {
|
|
156
|
+
hook._sent=true
|
|
150
157
|
el._unMountFunctions.push(hook)
|
|
151
158
|
})
|
|
152
159
|
const child=div.children[0]
|
|
@@ -162,10 +169,11 @@ export const normal_component=(el,stateContext,setStateContext,mapsPlugin,former
|
|
|
162
169
|
}
|
|
163
170
|
}
|
|
164
171
|
}
|
|
165
|
-
childInsert()
|
|
172
|
+
if(awaits === false)childInsert();
|
|
166
173
|
const lifeCircle=()=>{
|
|
167
174
|
Promise.resolve().then(()=>{
|
|
168
175
|
el._component?._hook?.effect.forEach((hook) => {
|
|
176
|
+
|
|
169
177
|
if(hook?.done) return
|
|
170
178
|
hook.done=true
|
|
171
179
|
const result=stateWatch(hook.effect,hook.deps)
|
|
@@ -200,7 +208,7 @@ export const normal_component=(el,stateContext,setStateContext,mapsPlugin,former
|
|
|
200
208
|
|
|
201
209
|
})
|
|
202
210
|
}
|
|
203
|
-
lifeCircle()
|
|
211
|
+
if(awaits === false)lifeCircle()
|
|
204
212
|
stateContexts._hasRun=true
|
|
205
213
|
keepContext(stateContexts._formerContext)
|
|
206
214
|
if (stateContexts._transportContext) {
|