Commit 5a8e43cd authored by 何毅恒's avatar 何毅恒

优化pc端首页自动加载第一条数据

parent b5e990c8
......@@ -118,13 +118,14 @@ const getInformationCategory = async () => {
let res = await post("information/getInformationCategory");
if (res.code == 0) {
categoryList.value = res.data;
getSecondInformationCategory(res.data[0].id, 0);
}
};
// 获取二级分类
const getSecondInformationCategory = async (parent_id, key) => {
let res = await post("information/getInformationCategory", { parent_id });
if (res.code == 0) {
categoryList.value[key].secondCategoryList = res.data;
categoryList.value[key].secondCategoryList = res.data;
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment