写法优化

This commit is contained in:
fofolee 2022-04-03 22:19:47 +08:00
parent 8ae8f52212
commit cfdd5a7e71
2 changed files with 3 additions and 3 deletions

View File

@ -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() {

View File

@ -325,7 +325,8 @@ export default {
);
default:
return commands.filter(
(cmd) => cmd.tags && cmd.tags.includes(this.currentTag)
//
(cmd) => cmd.tags?.includes(this.currentTag)
);
}
},