@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.
- package/dist/dialog/dialog.js +5 -1
- package/lib/dialog/dialog.js +5 -1
- package/package.json +1 -1
package/dist/dialog/dialog.js
CHANGED
@@ -36,7 +36,7 @@ export const contextRef = {
|
|
36
36
|
};
|
37
37
|
const Dialog = (options) => {
|
38
38
|
options = Object.assign(Object.assign({}, currentOptions), options);
|
39
|
-
|
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));
|
package/lib/dialog/dialog.js
CHANGED
@@ -53,7 +53,7 @@ exports.contextRef = {
|
|
53
53
|
};
|
54
54
|
var Dialog = function (options) {
|
55
55
|
options = __assign(__assign({}, currentOptions), options);
|
56
|
-
|
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) {
|