mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-30 21:13:02 +08:00
写法优化
This commit is contained in:
parent
8ae8f52212
commit
cfdd5a7e71
@ -235,8 +235,7 @@ export default {
|
|||||||
// 默认命令不可删除
|
// 默认命令不可删除
|
||||||
canCommandEdit() {
|
canCommandEdit() {
|
||||||
if (utools.isDev()) return true;
|
if (utools.isDev()) return true;
|
||||||
let tags = this.commandInfo.tags;
|
return this.commandInfo.tags?.includes("默认") ? false : true;
|
||||||
return tags && tags.includes("默认") ? false : true;
|
|
||||||
},
|
},
|
||||||
// 匹配类型的颜色
|
// 匹配类型的颜色
|
||||||
cmdBadgeColor() {
|
cmdBadgeColor() {
|
||||||
|
@ -325,7 +325,8 @@ export default {
|
|||||||
);
|
);
|
||||||
default:
|
default:
|
||||||
return commands.filter(
|
return commands.filter(
|
||||||
(cmd) => cmd.tags && cmd.tags.includes(this.currentTag)
|
// 可选链操作符
|
||||||
|
(cmd) => cmd.tags?.includes(this.currentTag)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user