buyer端的导航条下拉

master
pikachu 2022-04-12 18:03:31 +08:00
parent df408e640a
commit 9e0a681e01
1 changed files with 20 additions and 3 deletions

View File

@ -3,7 +3,7 @@
<div class="nav-con"> <div class="nav-con">
<div <div
class="all-categories hover-pointer" class="all-categories hover-pointer"
@mouseenter="showFirstList = true" @mouseenter="showFirstLists"
@mouseleave="showFirstList = false" @mouseleave="showFirstList = false"
> >
全部商品分类 全部商品分类
@ -16,6 +16,7 @@
@click="linkTo(item.url)" @click="linkTo(item.url)"
> >
{{ item.name }} {{ item.name }}
<!-- {{item}} -->
</li> </li>
</ul> </ul>
</div> </div>
@ -150,6 +151,22 @@ export default {
}, },
}, },
methods: { methods: {
showFirstLists(){
this.showFirstList = true;
if(
localStorage.getItem("category") &&
localStorage.getItem("category_expiration_time")
) {
// this.getCate();
//
if (new Date() > localStorage.getItem("category_expiration_time")) {
this.getCate();
return;
}
this.cateList = JSON.parse(localStorage.getItem("category"));
// this.$Message.info(cateList)
}
},
getCate() { getCate() {
// //
if (this.hover) return false; if (this.hover) return false;