首页+侧边栏

This commit is contained in:
2024-08-05 15:34:57 +08:00
parent ad0acc0f22
commit 38145f08ac
22 changed files with 308 additions and 314 deletions

View File

@@ -53,8 +53,6 @@ export default {
return {
// 顶部栏初始数
visibleNumber: 5,
// 当前激活菜单的 index
// currentIndex: undefined,
};
},
computed: {
@@ -140,10 +138,10 @@ export default {
methods: {
// 根据宽度计算设置显示栏数
setVisibleNumber() {
const width = window.innerWidth - 800;
const width = window.innerWidth - 700;
console.log(width);
console.log('window.innerWidth:', window.innerWidth);
this.visibleNumber = parseInt(width / 100);
this.visibleNumber = parseInt(width / 120);
console.log('this.visibleNumber:', this.visibleNumber);
},
// 菜单选择事件
@@ -181,6 +179,7 @@ export default {
},
// 当前激活的路由
activeRoutes(key) {
this.$store.dispatch('app/setChoicepart', key);
const routes = [];
if (this.childrenMenus && this.childrenMenus.length > 0) {
this.childrenMenus.map((item) => {