2 |
3 | {{ name }}
4 | static
5 |
6 |
7 |
8 |
9 |
30 |
31 |
41 |
42 |
47 |
--------------------------------------------------------------------------------
/packages/playground/scripts/genIconList.mjs:
--------------------------------------------------------------------------------
1 | /* eslint-disable no-console */
2 | import fs from 'fs'
3 | import axios from 'axios'
4 |
5 | const SVG_ICON_JSON_URL = 'https://at.alicdn.com/t/c/font_3736402_d50r1yq40hw.json'
6 |
7 | export async function genIconListJson() {
8 | try {
9 | const res = await axios.get(SVG_ICON_JSON_URL)
10 |
11 | if (res.status === 200) {
12 | const iconList = res.data.glyphs.map((item) => item.name)
13 | console.log(iconList)
14 | fs.writeFile(new URL('../src/assets/json/icons.json', import.meta.url), JSON.stringify(iconList, null, 2), (err) => {
15 | if (err) {
16 | return console.error(err)
17 | }
18 | console.log('图标清单写入成功!')
19 | })
20 | } else {
21 | console.error(res.status, res.statusText)
22 | }
23 | } catch (err) {
24 | console.error(err)
25 | }
26 | }
27 |
28 | genIconListJson()
29 |
--------------------------------------------------------------------------------
/packages/vue-pro-components/src/button/props.ts:
--------------------------------------------------------------------------------
1 | import type { ExtractPropTypes } from 'vue'
2 | // 这是一个函数
3 | import buttonProps from 'ant-design-vue/es/button/buttonTypes'
4 | import { initDefaultProps } from 'ant-design-vue/es/_util/props-util'
5 |
6 | const _buttonProps = initDefaultProps(buttonProps(), {
7 | type: 'default',
8 | })
9 |
10 | export const enhancedProps = {
11 | // 对应自定义图标的名称
12 | ico: {
13 | type: String,
14 | },
15 | // 图标的大小
16 | icoSize: {
17 | type: Number,
18 | },
19 | // 图标颜色
20 | icoColor: {
21 | type: String,
22 | },
23 | // 按钮主体颜色,影响边框颜色,背景色
24 | primaryColor: {
25 | type: String,
26 | },
27 | }
28 |
29 | export const innerKeys = Object.keys(_buttonProps)
30 | export const enhancedKeys = Object.keys(enhancedProps)
31 |
32 | export const props = {
33 | ..._buttonProps,
34 | ...enhancedProps,
35 | }
36 |
37 | export type VpButtonProps = Partial