@dcloudio/uni-quickapp-webview 3.0.0-alpha-3021320211117002 → 3.0.0-alpha-3021320211118001

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.
@@ -272,7 +272,7 @@ function getApiInterceptorHooks(method) {
272
272
  }
273
273
  return interceptor;
274
274
  }
275
- function invokeApi(method, api, options, ...params) {
275
+ function invokeApi(method, api, options, params) {
276
276
  const interceptor = getApiInterceptorHooks(method);
277
277
  if (interceptor && Object.keys(interceptor).length) {
278
278
  if (isArray(interceptor.invoke)) {
@@ -622,17 +622,17 @@ function promisify(name, api) {
622
622
  if (!isFunction(api)) {
623
623
  return api;
624
624
  }
625
- return function promiseApi(options = {}) {
625
+ return function promiseApi(options = {}, ...rest) {
626
626
  if (isFunction(options.success) ||
627
627
  isFunction(options.fail) ||
628
628
  isFunction(options.complete)) {
629
- return wrapperReturnValue(name, invokeApi(name, api, options));
629
+ return wrapperReturnValue(name, invokeApi(name, api, options, rest));
630
630
  }
631
631
  return wrapperReturnValue(name, handlePromise(new Promise((resolve, reject) => {
632
632
  invokeApi(name, api, extend({}, options, {
633
633
  success: resolve,
634
634
  fail: reject,
635
- }));
635
+ }), rest);
636
636
  })));
637
637
  };
638
638
  }
@@ -491,6 +491,16 @@ function initRefs(instance, mpInstance) {
491
491
  return $refs;
492
492
  },
493
493
  });
494
+ }
495
+ /**
496
+ * @param properties
497
+ */
498
+ function fixProperties(properties) {
499
+ Object.keys(properties).forEach((name) => {
500
+ if (properties[name] === null) {
501
+ properties[name] = undefined;
502
+ }
503
+ });
494
504
  }
495
505
 
496
506
  const PROP_TYPES = [String, Number, Boolean, Object, Array, null];
@@ -886,6 +896,13 @@ function initLifetimes$1({ mocks, isPage, initRelation, vueOptions, }) {
886
896
  if (mpType === 'page' && !mpInstance.route && mpInstance.__route__) {
887
897
  mpInstance.route = mpInstance.__route__;
888
898
  }
899
+ // 字节跳动小程序 properties
900
+ // 父组件在 attached 中 setData 设置了子组件的 props,在子组件的 attached 中,并不能立刻拿到
901
+ // 此时子组件的 properties 中获取到的值,除了一部分初始化就有的值,只要在模板上绑定了,动态设置的 prop 的值均会根据类型返回,不会应用 prop 自己的默认值
902
+ // 举例: easyinput 的 styles 属性,类型为 Object,`<easyinput :styles="styles"/>` 在 attached 中 styles 的值为 null
903
+ // 目前 null 值会影响 render 函数执行,临时解决方案,调整 properties 中的 null 值为 undefined,让 Vue 来补充为默认值
904
+ // 已知的其他隐患,当使用默认值时,可能组件行为不正确,比如 countdown 组件,默认值是0,导致直接就触发了 timeup 事件,这个应该是组件自身做处理?
905
+ // 难道要等父组件首次 setData 完成后,再去执行子组件的初始化?
889
906
  fixProperties(properties);
890
907
  this.$vm = $createComponent({
891
908
  type: vueOptions,
@@ -910,20 +927,6 @@ function initLifetimes$1({ mocks, isPage, initRelation, vueOptions, }) {
910
927
  {
911
928
  return { attached, detached };
912
929
  }
913
- }
914
- function fixProperties(properties) {
915
- // 字节跳动小程序 properties
916
- // 父组件在 attached 中 setData 设置了子组件的 props,在子组件的 attached 中,并不能立刻拿到
917
- // 此时子组件的 properties 中获取到的值,除了一部分初始化就有的值,只要在模板上绑定了,动态设置的 prop 的值均会根据类型返回,不会应用 prop 自己的默认值
918
- // 举例: easyinput 的 styles 属性,类型为 Object,`<easyinput :styles="styles"/>` 在 attached 中 styles 的值为 null
919
- // 目前 null 值会影响 render 函数执行,临时解决方案,调整 properties 中的 null 值为 undefined,让 Vue 来补充为默认值
920
- // 已知的其他隐患,当使用默认值时,可能组件行为不正确,比如 countdown 组件,默认值是0,导致直接就触发了 timeup 事件,这个应该是组件自身做处理?
921
- // 难道要等父组件首次 setData 完成后,再去执行子组件的初始化?
922
- Object.keys(properties).forEach((name) => {
923
- if (properties[name] === null) {
924
- properties[name] = undefined;
925
- }
926
- });
927
930
  }
928
931
 
929
932
  const instances = Object.create(null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/uni-quickapp-webview",
3
- "version": "3.0.0-alpha-3021320211117002",
3
+ "version": "3.0.0-alpha-3021320211118001",
4
4
  "description": "uni-app quickapp-webview",
5
5
  "main": "dist/index.js",
6
6
  "repository": {
@@ -25,10 +25,10 @@
25
25
  "@vue/compiler-core": "3.2.22"
26
26
  },
27
27
  "dependencies": {
28
- "@dcloudio/uni-cli-shared": "3.0.0-alpha-3021320211117002",
29
- "@dcloudio/uni-mp-vite": "3.0.0-alpha-3021320211117002",
30
- "@dcloudio/uni-mp-vue": "3.0.0-alpha-3021320211117002",
31
- "@dcloudio/uni-shared": "3.0.0-alpha-3021320211117002",
28
+ "@dcloudio/uni-cli-shared": "3.0.0-alpha-3021320211118001",
29
+ "@dcloudio/uni-mp-vite": "3.0.0-alpha-3021320211118001",
30
+ "@dcloudio/uni-mp-vue": "3.0.0-alpha-3021320211118001",
31
+ "@dcloudio/uni-shared": "3.0.0-alpha-3021320211118001",
32
32
  "@vue/shared": "3.2.22"
33
33
  }
34
34
  }