@tarojs/runtime 3.3.12 → 3.3.13
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/dist/runtime.esm.js +21 -15
- package/dist/runtime.esm.js.map +1 -1
- package/package.json +4 -4
package/dist/runtime.esm.js
CHANGED
|
@@ -4212,9 +4212,9 @@ function format(children, document, styleOptions, parent) {
|
|
|
4212
4212
|
.map((child) => {
|
|
4213
4213
|
// 文本节点
|
|
4214
4214
|
if (child.type === 'text') {
|
|
4215
|
-
|
|
4215
|
+
let text = document.createTextNode(child.content);
|
|
4216
4216
|
if (isFunction$1(options.html.transformText)) {
|
|
4217
|
-
|
|
4217
|
+
text = options.html.transformText(text, child);
|
|
4218
4218
|
}
|
|
4219
4219
|
parent === null || parent === void 0 ? void 0 : parent.appendChild(text);
|
|
4220
4220
|
return text;
|
|
@@ -5178,8 +5178,11 @@ function createPageConfig(component, pageName, data, pageConfig) {
|
|
|
5178
5178
|
let pageElement = null;
|
|
5179
5179
|
let unmounting = false;
|
|
5180
5180
|
let prepareMountList = [];
|
|
5181
|
+
let loadResolver;
|
|
5182
|
+
let hasLoaded;
|
|
5181
5183
|
const config = {
|
|
5182
5184
|
onLoad(options, cb) {
|
|
5185
|
+
hasLoaded = new Promise(resolve => { loadResolver = resolve; });
|
|
5183
5186
|
perf.start(PAGE_INIT);
|
|
5184
5187
|
Current.page = this;
|
|
5185
5188
|
this.config = pageConfig || {};
|
|
@@ -5203,6 +5206,7 @@ function createPageConfig(component, pageName, data, pageConfig) {
|
|
|
5203
5206
|
pageElement = document$2.getElementById(this.$taroPath);
|
|
5204
5207
|
ensure(pageElement !== null, '没有找到页面实例。');
|
|
5205
5208
|
safeExecute(this.$taroPath, 'onLoad', this.$taroParams);
|
|
5209
|
+
loadResolver();
|
|
5206
5210
|
if (!isBrowser) {
|
|
5207
5211
|
pageElement.ctx = this;
|
|
5208
5212
|
pageElement.performUpdate(true, cb);
|
|
@@ -5241,20 +5245,22 @@ function createPageConfig(component, pageName, data, pageConfig) {
|
|
|
5241
5245
|
});
|
|
5242
5246
|
},
|
|
5243
5247
|
onShow() {
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
|
|
5248
|
+
hasLoaded.then(() => {
|
|
5249
|
+
Current.page = this;
|
|
5250
|
+
this.config = pageConfig || {};
|
|
5251
|
+
const router = isBrowser ? this.$taroPath : this.route || this.__route__;
|
|
5252
|
+
Current.router = {
|
|
5253
|
+
params: this.$taroParams,
|
|
5254
|
+
path: addLeadingSlash(router),
|
|
5255
|
+
onReady: getOnReadyEventKey(id),
|
|
5256
|
+
onShow: getOnShowEventKey(id),
|
|
5257
|
+
onHide: getOnHideEventKey(id)
|
|
5258
|
+
};
|
|
5259
|
+
raf(() => {
|
|
5260
|
+
eventCenter.trigger(getOnShowEventKey(id));
|
|
5261
|
+
});
|
|
5262
|
+
safeExecute(this.$taroPath, 'onShow');
|
|
5256
5263
|
});
|
|
5257
|
-
safeExecute(this.$taroPath, 'onShow');
|
|
5258
5264
|
},
|
|
5259
5265
|
onHide() {
|
|
5260
5266
|
Current.page = null;
|