|
@@ -1,21 +1,20 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <div class="exposure">
|
|
|
|
|
- <div class="first-menu">
|
|
|
|
|
- <a-menu
|
|
|
|
|
- class="a-menu_container"
|
|
|
|
|
- theme="dark"
|
|
|
|
|
- v-model:selectedKeys="selectedKey"
|
|
|
|
|
- @click="selectMenu"
|
|
|
|
|
- mode="horizontal"
|
|
|
|
|
- >
|
|
|
|
|
- <a-menu-item :key="String(index)" v-for="(item, index) in list">{{ item.title}}</a-menu-item>
|
|
|
|
|
- </a-menu>
|
|
|
|
|
- <div class="menu_right">
|
|
|
|
|
- <!-- <slot></slot> -->
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <router-view />
|
|
|
|
|
|
|
+ <div class="exposure">
|
|
|
|
|
+ <div class="first-menu">
|
|
|
|
|
+ <a-menu class="a-menu_container"
|
|
|
|
|
+ theme="dark"
|
|
|
|
|
+ v-model:selectedKeys="selectedKey"
|
|
|
|
|
+ @click="selectMenu"
|
|
|
|
|
+ mode="horizontal">
|
|
|
|
|
+ <a-menu-item :key="String(index)"
|
|
|
|
|
+ v-for="(item, index) in list">{{ item.title}}</a-menu-item>
|
|
|
|
|
+ </a-menu>
|
|
|
|
|
+ <div class="menu_right">
|
|
|
|
|
+ <!-- <slot></slot> -->
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <router-view />
|
|
|
|
|
+ </div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
@@ -32,10 +31,10 @@ export default defineComponent({
|
|
|
const selectedKey = inject('index');
|
|
const selectedKey = inject('index');
|
|
|
// 切换路由
|
|
// 切换路由
|
|
|
function selectMenu(value: any) {
|
|
function selectMenu(value: any) {
|
|
|
- const index = +value.key;
|
|
|
|
|
- console.log(router);
|
|
|
|
|
-
|
|
|
|
|
- router.push({ name: list.value[index].code });
|
|
|
|
|
|
|
+ if (((selectedKey as unknown) as any).value[0] !== value.key) {
|
|
|
|
|
+ const index = +value.key;
|
|
|
|
|
+ router.push({ name: list.value[index].code });
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
return { selectMenu, list, selectedKey };
|
|
return { selectMenu, list, selectedKey };
|
|
|
},
|
|
},
|