소스 검색

导航栏选中

Xiao_123 4 달 전
부모
커밋
d82f796c33
2개의 변경된 파일11개의 추가작업 그리고 3개의 파일을 삭제
  1. 4 0
      components.d.ts
  2. 7 3
      src/layout/personal/navBar.vue

+ 4 - 0
components.d.ts

@@ -32,6 +32,7 @@ declare module 'vue' {
     Echarts: typeof import('./src/components/Echarts/index.vue')['default']
     ElCascader: typeof import('element-plus/es')['ElCascader']
     ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
+    ElImage: typeof import('element-plus/es')['ElImage']
     Empty: typeof import('./src/components/Empty/index.vue')['default']
     File: typeof import('./src/components/Upload/file.vue')['default']
     HeadSearch: typeof import('./src/components/headSearch/index.vue')['default']
@@ -75,4 +76,7 @@ declare module 'vue' {
     VerifySlide: typeof import('./src/components/Verifition/Verify/VerifySlide.vue')['default']
     WangEditor: typeof import('./src/components/FormUI/wangEditor/index.vue')['default']
   }
+  export interface ComponentCustomProperties {
+    vLoading: typeof import('element-plus/es')['ElLoadingDirective']
+  }
 }

+ 7 - 3
src/layout/personal/navBar.vue

@@ -205,9 +205,13 @@ const position = [
   '/recruit/personal/company/details',
   '/recruit/personal/position/details'
 ]
-const menuActive = computed(() => (val)=> {
-  return val.dealActive ? position.indexOf(route.path) !== -1 : (route.path === val.path || route.path.includes(val.path))
-})
+const menuActive = (val) => {
+  let path
+  position.forEach(e => {
+    if (route.path.indexOf(e) !== -1) path = e
+  })
+  return val.dealActive ? position.indexOf(path) !== -1 : (route.path === val.path || route.path.includes(val.path))
+}
 
 const vip = computed(() => {
   return new Date().getTime() < userStore.userInfo?.vipExpireDate