mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-30 04:42:45 +08:00
写法优化
This commit is contained in:
parent
8ae8f52212
commit
cfdd5a7e71
@ -235,8 +235,7 @@ export default {
|
||||
// 默认命令不可删除
|
||||
canCommandEdit() {
|
||||
if (utools.isDev()) return true;
|
||||
let tags = this.commandInfo.tags;
|
||||
return tags && tags.includes("默认") ? false : true;
|
||||
return this.commandInfo.tags?.includes("默认") ? false : true;
|
||||
},
|
||||
// 匹配类型的颜色
|
||||
cmdBadgeColor() {
|
||||
|
@ -325,7 +325,8 @@ export default {
|
||||
);
|
||||
default:
|
||||
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