写法优化

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

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