uptada
This commit is contained in:
parent
9b0f0282d4
commit
9d7612c647
@ -5,11 +5,25 @@
|
|||||||
<Logo v-if="showLogo" :collapse="isCollapse" />
|
<Logo v-if="showLogo" :collapse="isCollapse" />
|
||||||
<!-- 菜单 -->
|
<!-- 菜单 -->
|
||||||
<happy-scroll color="rgba(0,0,0,0.5)" size="5" class="menu-scroll-container">
|
<happy-scroll color="rgba(0,0,0,0.5)" size="5" class="menu-scroll-container">
|
||||||
<el-menu :collapse="isCollapse" :background-color="variables.menuBg" :text-color="variables.menuText"
|
|
||||||
:unique-opened="true" :active-text-color="variables.menuActiveText" :collapse-transition="false"
|
<el-menu
|
||||||
:default-active="$route.path" mode="vertical" class="el-menu-vertical">
|
:collapse="isCollapse"
|
||||||
<sidebar-item v-for="(route, index) in permission_routes" :key="index" :item="route"
|
:background-color="variables.menuBg"
|
||||||
:base-path="route.path" />
|
:text-color="variables.menuText"
|
||||||
|
:unique-opened="true"
|
||||||
|
:active-text-color="variables.menuActiveText"
|
||||||
|
:collapse-transition="false"
|
||||||
|
:default-active="$route.path"
|
||||||
|
mode="vertical"
|
||||||
|
class="el-menu-vertical"
|
||||||
|
>
|
||||||
|
<!-- 循环 filteredRoutes -->
|
||||||
|
<sidebar-item
|
||||||
|
v-for="(route, index) in filteredRoutes"
|
||||||
|
:key="index"
|
||||||
|
:item="route"
|
||||||
|
:base-path="route.path"
|
||||||
|
/>
|
||||||
</el-menu>
|
</el-menu>
|
||||||
</happy-scroll>
|
</happy-scroll>
|
||||||
</div>
|
</div>
|
||||||
@ -26,8 +40,11 @@ export default {
|
|||||||
name: "Sidebar",
|
name: "Sidebar",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
role: ''
|
role: '',
|
||||||
|
homePageRouteIdentifier: (route) => {
|
||||||
|
return route.name === 'homePage';
|
||||||
}
|
}
|
||||||
|
};
|
||||||
},
|
},
|
||||||
components: { SidebarItem, Logo },
|
components: { SidebarItem, Logo },
|
||||||
computed: {
|
computed: {
|
||||||
@ -41,6 +58,13 @@ export default {
|
|||||||
isCollapse() {
|
isCollapse() {
|
||||||
return !this.sidebar.opened;
|
return !this.sidebar.opened;
|
||||||
},
|
},
|
||||||
|
// --- 新增计算属性:过滤后的路由 ---
|
||||||
|
filteredRoutes() {
|
||||||
|
if (!this.permission_routes) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
return this.permission_routes.filter(route => !this.homePageRouteIdentifier(route));
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
@ -106,3 +130,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="mainBox">
|
<div class="mainBox">
|
||||||
|
<!-- 粘性导航组件 -->
|
||||||
<HomePageSticky
|
<HomePageSticky
|
||||||
ref="stickyNav"
|
ref="stickyNav"
|
||||||
:sections="stickySections"
|
:sections="stickySections"
|
||||||
@navigate="handleNavigation"
|
@navigate="handleNavigation"
|
||||||
|
:show-threshold-element-selector="'.tagUl'"
|
||||||
|
:show-offset="0"
|
||||||
></HomePageSticky>
|
></HomePageSticky>
|
||||||
|
|
||||||
<div id="banner" class="banner">
|
<div id="banner" class="banner">
|
||||||
@ -15,6 +17,7 @@
|
|||||||
</span>
|
</span>
|
||||||
<span class="rightText"> 您身边的AI管家</span>
|
<span class="rightText"> 您身边的AI管家</span>
|
||||||
</span>
|
</span>
|
||||||
|
<!-- 当滚动到这个元素位置时,显示粘性导航 -->
|
||||||
<ul style="margin-top: 50px" class="tagUl">
|
<ul style="margin-top: 50px" class="tagUl">
|
||||||
<li>全 球 领 先 的 AI 服 务 运 营 商</li>
|
<li>全 球 领 先 的 AI 服 务 运 营 商</li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -508,8 +511,6 @@ export default Vue.extend({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
||||||
|
|
||||||
// 添加动画样式
|
// 添加动画样式
|
||||||
.slide-fade-enter-active {
|
.slide-fade-enter-active {
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
@ -1349,5 +1350,10 @@ export default Vue.extend({
|
|||||||
position: sticky;
|
position: sticky;
|
||||||
top: 0px;
|
top: 0px;
|
||||||
z-index: 999;
|
z-index: 999;
|
||||||
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user