提交 897cc851 编写于 作者: yubinCloud's avatar yubinCloud

7-6 用 for..of.. 语法代替 forEach 循环 categories 防止因为 undefined 出错

上级 ca253cc0
......@@ -290,11 +290,11 @@ export default defineComponent({
const getCategoryName = (cid: string) => {
let result = "";
categories.forEach((item: Category) => {
for (let item of categories) {
if (item.id === cid) {
result = item.name;
}
});
}
return result;
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册