@tuya-miniapp/smart-ui 2.3.0-beta-6 → 2.3.0-beta-7

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.
@@ -36,7 +36,7 @@ export const contextRef = {
36
36
  };
37
37
  const Dialog = (options) => {
38
38
  options = Object.assign(Object.assign({}, currentOptions), options);
39
- return new Promise((resolve, reject) => {
39
+ const prom = new Promise((resolve, reject) => {
40
40
  appLog.info('start open dialog');
41
41
  const context = (typeof options.context === 'function' ? options.context() : options.context) ||
42
42
  contextRef.value[options.selector] ||
@@ -79,6 +79,10 @@ const Dialog = (options) => {
79
79
  appLog.info(`未找到 ${(selector !== null && selector !== void 0 ? selector : '#smart-dialog').replace('#', '')} 节点,请确认 selector 及 context 是否正确`);
80
80
  }
81
81
  });
82
+ prom.catch(err => {
83
+ console.log(err, '---Dialog-error');
84
+ });
85
+ return prom;
82
86
  };
83
87
  Dialog.alert = (options) => Dialog(options);
84
88
  Dialog.confirm = (options) => Dialog(Object.assign({ showCancelButton: true }, options));
@@ -53,7 +53,7 @@ exports.contextRef = {
53
53
  };
54
54
  var Dialog = function (options) {
55
55
  options = __assign(__assign({}, currentOptions), options);
56
- return new Promise(function (resolve, reject) {
56
+ var prom = new Promise(function (resolve, reject) {
57
57
  appLog_1.default.info('start open dialog');
58
58
  var context = (typeof options.context === 'function' ? options.context() : options.context) ||
59
59
  exports.contextRef.value[options.selector] ||
@@ -96,6 +96,10 @@ var Dialog = function (options) {
96
96
  appLog_1.default.info("\u672A\u627E\u5230 ".concat((selector !== null && selector !== void 0 ? selector : '#smart-dialog').replace('#', ''), " \u8282\u70B9\uFF0C\u8BF7\u786E\u8BA4 selector \u53CA context \u662F\u5426\u6B63\u786E"));
97
97
  }
98
98
  });
99
+ prom.catch(function (err) {
100
+ console.log(err, '---Dialog-error');
101
+ });
102
+ return prom;
99
103
  };
100
104
  Dialog.alert = function (options) { return Dialog(options); };
101
105
  Dialog.confirm = function (options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuya-miniapp/smart-ui",
3
- "version": "2.3.0-beta-6",
3
+ "version": "2.3.0-beta-7",
4
4
  "author": "MiniApp Team",
5
5
  "license": "MIT",
6
6
  "miniprogram": "lib",