未验证 提交 a4520867 编写于 作者: L Lovell Liu 提交者: GitHub

Fix/workbech page (#2264)

* fix: fix display issues when reloading page

* feat: change a fit color for js-logo icon

* fix: prevent layout chaos because of text wrap
上级 39188780
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<a-button type="link" size="small">更多</a-button> <a-button type="link" size="small">更多</a-button>
</template> </template>
<CardGrid v-for="item in items" :key="item" class="!md:w-1/3 !w-full"> <CardGrid v-for="item in items" :key="item.title" class="!md:w-1/3 !w-full">
<span class="flex"> <span class="flex">
<Icon :icon="item.icon" :color="item.color" size="30" /> <Icon :icon="item.icon" :color="item.color" size="30" />
<span class="text-lg ml-4">{{ item.title }}</span> <span class="text-lg ml-4">{{ item.title }}</span>
...@@ -19,12 +19,12 @@ ...@@ -19,12 +19,12 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent } from 'vue'; import { defineComponent } from 'vue';
import { Card } from 'ant-design-vue'; import { Card, CardGrid } from 'ant-design-vue';
import { Icon } from '/@/components/Icon'; import { Icon } from '/@/components/Icon';
import { groupItems } from './data'; import { groupItems } from './data';
export default defineComponent({ export default defineComponent({
components: { Card, CardGrid: Card.Grid, Icon }, components: { Card, CardGrid, Icon },
setup() { setup() {
return { items: groupItems }; return { items: groupItems };
}, },
......
<template> <template>
<Card title="快捷导航" v-bind="$attrs"> <Card title="快捷导航">
<CardGrid v-for="item in navItems" :key="item"> <CardGrid v-for="item in navItems" :key="item.title">
<span class="flex flex-col items-center"> <span class="flex flex-col items-center">
<Icon :icon="item.icon" :color="item.color" size="20" /> <Icon :icon="item.icon" :color="item.color" size="20" />
<span class="text-md mt-2">{{ item.title }}</span> <span class="text-md mt-2 truncate">{{ item.title }}</span>
</span> </span>
</CardGrid> </CardGrid>
</Card> </Card>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { Card } from 'ant-design-vue'; import { Card, CardGrid } from 'ant-design-vue';
import { navItems } from './data'; import { navItems } from './data';
import { Icon } from '/@/components/Icon'; import { Icon } from '/@/components/Icon';
const CardGrid = Card.Grid;
</script> </script>
...@@ -148,7 +148,7 @@ export const groupItems: GroupItem[] = [ ...@@ -148,7 +148,7 @@ export const groupItems: GroupItem[] = [
{ {
title: 'Js', title: 'Js',
icon: 'ion:logo-javascript', icon: 'ion:logo-javascript',
color: '#4daf1bc9', color: '#EBD94E',
desc: '路是走出来的,而不是空想出来的。', desc: '路是走出来的,而不是空想出来的。',
group: '架构组', group: '架构组',
date: '2021-04-01', date: '2021-04-01',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册