Ben Lin
2024-03-24 b72cc34ab2fef7d6bcaca3e2b11231713d622fce
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<template>
  <Card title="快捷导航">
    <CardGrid v-for="item in navItems" :key="item.title" @click="changeItem(item.url)">
      <span class="flex flex-col items-center">
        <Icon :icon="item.icon" :color="item.color" size="20" />
        <span class="text-md mt-2 truncate">{{ item.title }}</span>
      </span>
    </CardGrid>
  </Card>
</template>
<script lang="ts" setup>
  import { Card, CardGrid } from 'ant-design-vue';
  import { navItems } from './data';
  import Icon from '@/components/Icon/Icon.vue';
  import { useGo } from '/@/hooks/web/usePage';
 
  const go = useGo();
 
  function changeItem(url) {
    go(url);
    console.log('url', url);
  }
</script>