pawajs 1.4.1 → 1.4.3
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 +9 -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,10 @@ export const normal_component=(el,stateContext,setStateContext,mapsPlugin,former
|
|
|
135
137
|
console.error(error.message)
|
|
136
138
|
}
|
|
137
139
|
}
|
|
140
|
+
|
|
138
141
|
const childInsert=()=>{
|
|
139
142
|
el._component?._hook?.beforeMount?.forEach((bfm) => {
|
|
143
|
+
bfm._sent=true
|
|
140
144
|
const result= bfm(comment)
|
|
141
145
|
if (typeof result === 'function') {
|
|
142
146
|
el._unMountFunctions.push(result)
|
|
@@ -144,9 +148,11 @@ export const normal_component=(el,stateContext,setStateContext,mapsPlugin,former
|
|
|
144
148
|
})
|
|
145
149
|
|
|
146
150
|
el._component?._hook?.isMount.forEach((hook) => {
|
|
151
|
+
hook._sent=true
|
|
147
152
|
el._MountFunctions.push(hook)
|
|
148
153
|
})
|
|
149
154
|
el._component?._hook?.isUnMount.forEach((hook) => {
|
|
155
|
+
hook._sent=true
|
|
150
156
|
el._unMountFunctions.push(hook)
|
|
151
157
|
})
|
|
152
158
|
const child=div.children[0]
|
|
@@ -162,10 +168,11 @@ export const normal_component=(el,stateContext,setStateContext,mapsPlugin,former
|
|
|
162
168
|
}
|
|
163
169
|
}
|
|
164
170
|
}
|
|
165
|
-
childInsert()
|
|
171
|
+
if(awaits === false)childInsert();
|
|
166
172
|
const lifeCircle=()=>{
|
|
167
173
|
Promise.resolve().then(()=>{
|
|
168
174
|
el._component?._hook?.effect.forEach((hook) => {
|
|
175
|
+
|
|
169
176
|
if(hook?.done) return
|
|
170
177
|
hook.done=true
|
|
171
178
|
const result=stateWatch(hook.effect,hook.deps)
|
|
@@ -200,7 +207,7 @@ export const normal_component=(el,stateContext,setStateContext,mapsPlugin,former
|
|
|
200
207
|
|
|
201
208
|
})
|
|
202
209
|
}
|
|
203
|
-
lifeCircle()
|
|
210
|
+
if(awaits === false)lifeCircle()
|
|
204
211
|
stateContexts._hasRun=true
|
|
205
212
|
keepContext(stateContexts._formerContext)
|
|
206
213
|
if (stateContexts._transportContext) {
|