@tarojs/runtime 3.3.9 → 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.
@@ -1688,7 +1688,8 @@ const styleProperties = [
1688
1688
  'whiteSpace',
1689
1689
  'widows',
1690
1690
  'width',
1691
- 'zIndex'
1691
+ 'zIndex',
1692
+ 'pointerEvents'
1692
1693
  /** 非常用 style */
1693
1694
  // 'azimuth',
1694
1695
  // 'backfaceVisibility',
@@ -4211,9 +4212,9 @@ function format(children, document, styleOptions, parent) {
4211
4212
  .map((child) => {
4212
4213
  // 文本节点
4213
4214
  if (child.type === 'text') {
4214
- const text = document.createTextNode(child.content);
4215
+ let text = document.createTextNode(child.content);
4215
4216
  if (isFunction$1(options.html.transformText)) {
4216
- return options.html.transformText(text, child);
4217
+ text = options.html.transformText(text, child);
4217
4218
  }
4218
4219
  parent === null || parent === void 0 ? void 0 : parent.appendChild(text);
4219
4220
  return text;
@@ -5177,8 +5178,11 @@ function createPageConfig(component, pageName, data, pageConfig) {
5177
5178
  let pageElement = null;
5178
5179
  let unmounting = false;
5179
5180
  let prepareMountList = [];
5181
+ let loadResolver;
5182
+ let hasLoaded;
5180
5183
  const config = {
5181
5184
  onLoad(options, cb) {
5185
+ hasLoaded = new Promise(resolve => { loadResolver = resolve; });
5182
5186
  perf.start(PAGE_INIT);
5183
5187
  Current.page = this;
5184
5188
  this.config = pageConfig || {};
@@ -5202,6 +5206,7 @@ function createPageConfig(component, pageName, data, pageConfig) {
5202
5206
  pageElement = document$2.getElementById(this.$taroPath);
5203
5207
  ensure(pageElement !== null, '没有找到页面实例。');
5204
5208
  safeExecute(this.$taroPath, 'onLoad', this.$taroParams);
5209
+ loadResolver();
5205
5210
  if (!isBrowser) {
5206
5211
  pageElement.ctx = this;
5207
5212
  pageElement.performUpdate(true, cb);
@@ -5240,20 +5245,22 @@ function createPageConfig(component, pageName, data, pageConfig) {
5240
5245
  });
5241
5246
  },
5242
5247
  onShow() {
5243
- Current.page = this;
5244
- this.config = pageConfig || {};
5245
- const router = isBrowser ? this.$taroPath : this.route || this.__route__;
5246
- Current.router = {
5247
- params: this.$taroParams,
5248
- path: addLeadingSlash(router),
5249
- onReady: getOnReadyEventKey(id),
5250
- onShow: getOnShowEventKey(id),
5251
- onHide: getOnHideEventKey(id)
5252
- };
5253
- raf(() => {
5254
- eventCenter.trigger(getOnShowEventKey(id));
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');
5255
5263
  });
5256
- safeExecute(this.$taroPath, 'onShow');
5257
5264
  },
5258
5265
  onHide() {
5259
5266
  Current.page = null;
@@ -6070,6 +6077,27 @@ function createVue3App(app, h, config) {
6070
6077
  if (isBrowser) {
6071
6078
  appInstance = app.mount('#app');
6072
6079
  }
6080
+ // 把 App Class 上挂载的额外属性同步到全局 app 对象中
6081
+ // eslint-disable-next-line dot-notation
6082
+ if (app['taroGlobalData']) {
6083
+ // eslint-disable-next-line dot-notation
6084
+ const globalData = app['taroGlobalData'];
6085
+ const keys = Object.keys(globalData);
6086
+ const descriptors = Object.getOwnPropertyDescriptors(globalData);
6087
+ keys.forEach(key => {
6088
+ Object.defineProperty(this, key, {
6089
+ configurable: true,
6090
+ enumerable: true,
6091
+ get() {
6092
+ return globalData[key];
6093
+ },
6094
+ set(value) {
6095
+ globalData[key] = value;
6096
+ }
6097
+ });
6098
+ });
6099
+ Object.defineProperties(this, descriptors);
6100
+ }
6073
6101
  const onLaunch = (_a = appInstance === null || appInstance === void 0 ? void 0 : appInstance.$options) === null || _a === void 0 ? void 0 : _a.onLaunch;
6074
6102
  isFunction$1(onLaunch) && onLaunch.call(appInstance, options);
6075
6103
  }