【功能修复】商品分类界面,有 categoryId 匹配不对的问题

pull/134/MERGE
YunaiV 2025-01-04 09:10:58 +08:00
parent 515b8bb00f
commit bc0e731fc3
1 changed files with 3 additions and 3 deletions

View File

@ -23,7 +23,7 @@
scroll-y scroll-y
:style="[{ height: pageHeight + 'px' }]" :style="[{ height: pageHeight + 'px' }]"
v-if="state.categoryList?.length" v-if="state.categoryList?.length"
@scrolltolower="handleScrollToLower" @scrolltolower="handleScrollToLower"
> >
<image <image
v-if="state.categoryList[state.activeMenu].picUrl" v-if="state.categoryList[state.activeMenu].picUrl"
@ -136,14 +136,14 @@
await getList(); await getList();
// //
const foundCategory = state.categoryList.find(category => category.id === params.id); const foundCategory = state.categoryList.find((category) => category.id === Number(params.id));
// onMenu onMenu(0) // onMenu onMenu(0)
onMenu(foundCategory ? state.categoryList.indexOf(foundCategory) : 0); onMenu(foundCategory ? state.categoryList.indexOf(foundCategory) : 0);
}); });
function handleScrollToLower() { function handleScrollToLower() {
loadMore(); loadMore();
}; }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>