index.vue 938 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <template>
  2. <!-- 客户信息 -->
  3. <div class="custom">
  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: 'custom_info_normal', value: '正常' },
  19. { key: 'custom_info_stop', value: '停用' },
  20. ];
  21. function selectMenu(item: any) {
  22. router.push({ name: item.key });
  23. }
  24. return { list, selectMenu };
  25. }
  26. export default defineComponent({
  27. name: 'custom',
  28. components: {
  29. firstMenu,
  30. },
  31. setup() {
  32. const { list, selectMenu } = handleMenu();
  33. return { list, selectMenu };
  34. },
  35. });
  36. </script>
  37. <style lang="less"></style>;