Blame view

src/views/demo/feat/icon/index.vue 2.98 KB
陈文彬 authored
1
<template>
2
  <PageWrapper title="Icon组件示例">
陈文彬 authored
3
4
5
6
7
8
9
10
11
12
13
14
    <CollapseContainer title="Antv Icon使用 (直接按需引入相应组件即可)">
      <div class="flex justify-around">
        <GithubFilled :style="{ fontSize: '30px' }" />
        <QqCircleFilled :style="{ fontSize: '30px' }" />
        <WechatFilled :style="{ fontSize: '30px' }" />
        <AlipayCircleFilled :style="{ fontSize: '30px' }" />
        <IeCircleFilled :style="{ fontSize: '30px' }" />
        <TaobaoCircleFilled :style="{ fontSize: '30px' }" />
        <CodepenCircleFilled :style="{ fontSize: '30px' }" />
      </div>
    </CollapseContainer>
15
    <CollapseContainer title="IconIfy 组件使用" class="my-5">
陈文彬 authored
16
      <div class="flex justify-around flex-wrap">
17
18
19
20
21
22
23
        <Icon icon="ion:layers-outline" :size="30" />
        <Icon icon="ion:bar-chart-outline" :size="30" />
        <Icon icon="ion:tv-outline" :size="30" />
        <Icon icon="ion:settings-outline" :size="30" />
      </div>
    </CollapseContainer>
24
    <CollapseContainer title="svg 雪碧图" class="my-5">
Vben authored
25
26
      <div class="flex justify-around flex-wrap">
        <SvgIcon name="test" size="32" />
Vben authored
27
28
29
        <template v-for="item in 6" :key="item">
          <SvgIcon :name="`dynamic-avatar-${item}`" size="32" />
        </template>
Vben authored
30
31
32
      </div>
    </CollapseContainer>
33
    <CollapseContainer title="图标选择器(Iconify)" class="my-5">
34
35
      <div class="flex justify-around flex-wrap">
        <IconPicker />
陈文彬 authored
36
37
38
      </div>
    </CollapseContainer>
39
40
41
42
43
44
    <CollapseContainer title="图标选择器(Svg)" class="my-5">
      <div class="flex justify-around flex-wrap">
        <IconPicker mode="svg" />
      </div>
    </CollapseContainer>
陈文彬 authored
45
46
47
    <Alert
      show-icon
      message="推荐使用Iconify组件"
48
      description="Icon组件基本包含所有的图标,在下面网址内你可以查询到你想要的任何图标。并且打包只会打包所用到的图标。"
陈文彬 authored
49
    />
50
    <a-button type="link" @click="toIconify"> Iconify 图标大全 </a-button>
51
  </PageWrapper>
陈文彬 authored
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
</template>
<script lang="ts">
  import { defineComponent } from 'vue';
  import { CollapseContainer } from '/@/components/Container/index';
  import { Alert } from 'ant-design-vue';
  import {
    QqCircleFilled,
    GithubFilled,
    WechatFilled,
    AlipayCircleFilled,
    IeCircleFilled,
    TaobaoCircleFilled,
    CodepenCircleFilled,
  } from '@ant-design/icons-vue';
Vben authored
67
  import { Icon, IconPicker, SvgIcon } from '/@/components/Icon/index';
陈文彬 authored
68
vben authored
69
  import { openWindow } from '/@/utils';
70
  import { PageWrapper } from '/@/components/Page';
vben authored
71
陈文彬 authored
72
73
  export default defineComponent({
    components: {
74
      PageWrapper,
陈文彬 authored
75
76
77
78
79
80
81
82
83
84
      CollapseContainer,
      GithubFilled,
      QqCircleFilled,
      WechatFilled,
      AlipayCircleFilled,
      IeCircleFilled,
      TaobaoCircleFilled,
      CodepenCircleFilled,
      Icon,
      Alert,
85
      IconPicker,
Vben authored
86
      SvgIcon,
陈文彬 authored
87
88
89
90
    },
    setup() {
      return {
        toIconify: () => {
vben authored
91
          openWindow('https://iconify.design/');
陈文彬 authored
92
93
94
95
96
        },
      };
    },
  });
</script>