u
This commit is contained in:
1 parent
8a25c14a1b
commit
7cd7bbd166
34 files changed
+516
-227
No files matched your search
@@ -8,7 +8,7 @@ const userStore = useUserStore()
|
||||
|
||||
const menuList = [
|
||||
{ name: '首页', path: '/' },
|
||||
{ name: '企业名录', path: '/companies' },
|
||||
{ name: '企业名录', path: '/company' },
|
||||
{ name: '论坛中心', path: '/forum' },
|
||||
{ name: '关于我们', path: '/companies' },
|
||||
{ name: '联系我们', path: '/forum' },
|
||||
@@ -23,6 +23,13 @@ function exitLogin() {
|
||||
|
||||
navigateTo('/auth/login')
|
||||
}
|
||||
|
||||
function isActive(path: string) {
|
||||
if (path === '/') {
|
||||
return route.path === '/'
|
||||
}
|
||||
return route.path === path || route.path.startsWith(`${path}/`)
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -33,8 +40,9 @@ function exitLogin() {
|
||||
<span
|
||||
v-for="item in menuList"
|
||||
:key="item.path"
|
||||
:class="{ active: route.path.startsWith(item.path) }"
|
||||
:class="{ active: isActive(item.path) }"
|
||||
class="menu-item"
|
||||
@click="navigateTo(item.path)"
|
||||
>
|
||||
<span class="menu-item-name">
|
||||
{{ item.name }}
|
||||
|
||||
Reference in new issue
Block a user