|
@@ -2,7 +2,7 @@
|
|
|
<!-- 商品信息 -->
|
|
<!-- 商品信息 -->
|
|
|
<div class="goods-info">
|
|
<div class="goods-info">
|
|
|
<firstMenu :list="list"
|
|
<firstMenu :list="list"
|
|
|
- :value="'value'"
|
|
|
|
|
|
|
+ :value="'title'"
|
|
|
@selectMenu="selectMenu" />
|
|
@selectMenu="selectMenu" />
|
|
|
<router-view />
|
|
<router-view />
|
|
|
</div>
|
|
</div>
|
|
@@ -11,21 +11,8 @@
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
|
import { defineComponent } from 'vue';
|
|
import { defineComponent } from 'vue';
|
|
|
import firstMenu from '@/components/firstMenu/index.vue';
|
|
import firstMenu from '@/components/firstMenu/index.vue';
|
|
|
-import { useRouter } from 'vue-router';
|
|
|
|
|
-import { GoodsInfo } from '@/enums/routerName';
|
|
|
|
|
-
|
|
|
|
|
-// 处理菜单
|
|
|
|
|
-function handleMenu() {
|
|
|
|
|
- const router = useRouter();
|
|
|
|
|
- const list = [
|
|
|
|
|
- { key: GoodsInfo.spot, value: '现货品种' },
|
|
|
|
|
- { key: GoodsInfo.hedging, value: '套保品种' },
|
|
|
|
|
- ];
|
|
|
|
|
- function selectMenu(item: any) {
|
|
|
|
|
- router.push({ name: item.key });
|
|
|
|
|
- }
|
|
|
|
|
- return { list, selectMenu };
|
|
|
|
|
-}
|
|
|
|
|
|
|
+import { handleRouterMenu } from '@/setup/router/index';
|
|
|
|
|
+import { initData } from '@/setup/methods/index';
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
name: 'custom',
|
|
name: 'custom',
|
|
@@ -33,7 +20,11 @@ export default defineComponent({
|
|
|
firstMenu,
|
|
firstMenu,
|
|
|
},
|
|
},
|
|
|
setup() {
|
|
setup() {
|
|
|
- const { list, selectMenu } = handleMenu();
|
|
|
|
|
|
|
+ const { list, selectMenu, getMenuList } = handleRouterMenu();
|
|
|
|
|
+ initData(() => {
|
|
|
|
|
+ getMenuList();
|
|
|
|
|
+ console.log('list', list);
|
|
|
|
|
+ });
|
|
|
return { list, selectMenu };
|
|
return { list, selectMenu };
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|