fix(#24,#25,#26,#27,#30): action按钮顺序; group边界; Notification权限; queue catch; 新增功能测试
This commit is contained in:
+15
-4
@@ -1018,7 +1018,7 @@ const meToast = {
|
||||
|
||||
const t = this._emit({
|
||||
...normalized,
|
||||
html: _actionHTML(actions) + (normalized.html || ''),
|
||||
html: (normalized.html || '') + _actionHTML(actions),
|
||||
});
|
||||
|
||||
if (Array.isArray(actions)) {
|
||||
@@ -1090,6 +1090,7 @@ const meToast = {
|
||||
});
|
||||
return {
|
||||
then: (fn, rj) => promise.then(fn, rj),
|
||||
catch: (rj) => promise.catch(rj),
|
||||
cancel: () => { cancelled = true; },
|
||||
};
|
||||
},
|
||||
@@ -1167,9 +1168,19 @@ const meToast = {
|
||||
const g = { _group: name };
|
||||
methods.forEach(m => {
|
||||
g[m] = (...args) => {
|
||||
const last = typeof args[args.length - 1] === 'object' && args[args.length - 1] !== null && !Array.isArray(args[args.length - 1])
|
||||
? args.pop() : {};
|
||||
return self[m](...args, { ...last, group: name });
|
||||
const lastArg = args[args.length - 1];
|
||||
const isObj = typeof lastArg === 'object' && lastArg !== null && !Array.isArray(lastArg);
|
||||
// 单对象参数:直接合并group
|
||||
if (isObj && args.length === 1) {
|
||||
return self[m]({ ...lastArg, group: name });
|
||||
}
|
||||
// 末尾是配置对象:pop后合并
|
||||
if (isObj) {
|
||||
args.pop();
|
||||
return self[m](...args, { ...lastArg, group: name });
|
||||
}
|
||||
// 无配置对象
|
||||
return self[m](...args, { group: name });
|
||||
};
|
||||
});
|
||||
g.dismiss = () => self.dismissGroup(name);
|
||||
|
||||
Reference in New Issue
Block a user