Skip to content

Commit

Permalink
fix: icon 组件文档修改
Browse files Browse the repository at this point in the history
  • Loading branch information
oasis-cloud committed Jan 7, 2022
1 parent 512ab22 commit 64a3ee1
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 86 deletions.
24 changes: 0 additions & 24 deletions scripts/vite-demo-plugin.ts

This file was deleted.

43 changes: 27 additions & 16 deletions src/packages/icon/demo.tsx
Original file line number Diff line number Diff line change
@@ -1,37 +1,48 @@
import React from 'react'
import { Icon } from './icon'
import Cell from '../cell'
import CellGroup from '../cellgroup'
import icons from '@/styles/font/iconfont.json'

const IconDemo = () => {
return (
<>
<div className="demo">
<h2>基础用法</h2>
<Icon name="dongdong"></Icon>
<Icon name="JD"></Icon>
<Cell>
<Icon name="dongdong"></Icon>
<Icon name="JD"></Icon>
</Cell>
<h2>图片链接</h2>
<Icon
size="40"
name="https://img11.360buyimg.com/imagetools/jfs/t1/137646/13/7132/1648/5f4c748bE43da8ddd/a3f06d51dcae7b60.png"
></Icon>
<Cell>
<Icon
size="40"
name="https://img11.360buyimg.com/imagetools/jfs/t1/137646/13/7132/1648/5f4c748bE43da8ddd/a3f06d51dcae7b60.png"
></Icon>
</Cell>
<h2>图标颜色</h2>
<Icon name="dongdong" color="#fa2c19"></Icon>
<Icon name="dongdong" color="#64b578"></Icon>
<Icon name="JD" color="#fa2c19"></Icon>
<Cell>
<Icon name="dongdong" color="#fa2c19"></Icon>
<Icon name="dongdong" color="#64b578"></Icon>
<Icon name="JD" color="#fa2c19"></Icon>
</Cell>
<h2>图标大小</h2>
<Icon name="dongdong"></Icon>
<Icon name="dongdong" size="24"></Icon>
<Icon name="dongdong" size="16"></Icon>
<Cell>
<Icon name="dongdong"></Icon>
<Icon name="dongdong" size="24"></Icon>
<Icon name="dongdong" size="16"></Icon>
</Cell>
<h2>基础图标</h2>
<ul>
<CellGroup>
{icons.glyphs.map((item) => {
return (
<li key={item.font_class}>
<Cell key={item.font_class}>
<Icon name={item.font_class}></Icon>
<span>{item.name}</span>
</li>
</Cell>
)
})}
</ul>
</CellGroup>
</div>
</>
)
Expand Down
46 changes: 0 additions & 46 deletions vite.config.build.es.ts

This file was deleted.

0 comments on commit 64a3ee1

Please sign in to comment.