index.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <!-- 现货合同 -->
  3. <div class="spot-contract">
  4. <firstMenu :list="list"
  5. :value="'value'"
  6. @selectMenu="selectMenu" />
  7. <router-view />
  8. </div>
  9. </template>
  10. <script lang="ts">
  11. import { defineComponent } from 'vue';
  12. import firstMenu from '@/components/firstMenu/index.vue';
  13. import { useRouter } from 'vue-router';
  14. // 处理菜单
  15. function handleMenu() {
  16. const router = useRouter();
  17. const list = [
  18. { key: 'spot_contract-not-commit', value: '未提交' },
  19. { key: 'spot_contract-peddding', value: '待审核' },
  20. { key: 'spot_contract-performance', value: '履约中' },
  21. { key: 'spot_contract-done', value: '已完成' },
  22. ];
  23. function selectMenu(item: any) {
  24. router.push({ name: item.key });
  25. }
  26. return { list, selectMenu };
  27. }
  28. export default defineComponent({
  29. name: 'spot-contract',
  30. components: {
  31. firstMenu,
  32. },
  33. setup() {
  34. const { list, selectMenu } = handleMenu();
  35. return { list, selectMenu };
  36. },
  37. });
  38. </script>
  39. <style lang="less">
  40. .spot-contract {
  41. }
  42. </style>;