如果从主页点击某个分类进入分类页面,则自动选中左侧的一级分类

pull/72/head
卢越 2024-08-09 20:16:56 +08:00
parent 7a3f98e5fc
commit b093f99ab5
1 changed files with 9 additions and 1 deletions

View File

@ -131,8 +131,16 @@
getGoodsList();
}
onLoad(async () => {
onLoad(async (params) => {
await getList();
//
const cateList = state.categoryList
for (let index = 0; index < cateList.length;index++) {
if (cateList[index].id == params.id) {
state.activeMenu = index
break;
}
}
// first
if (state.style === 'first_one' || state.style === 'first_two') {
onMenu(0);