-
zhangwei
2025-03-05 16213c0f85aa3ac8317797bf4a05fd12940e16d3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import { AllowedComponentProps, VNodeProps } from './_common'
import { ImageMode } from './image'
 
declare interface IconProps {
  /**
   * 图标名称,如名称带有`/`,会被认为是图片图标
   */
  name?: string
  /**
   * 图标颜色
   * @default "color['u-content-color']"
   */
  color?: string
  /**
   * 图标字体大小,单位默认px
   * @default "16px"
   */
  size?: string | number
  /**
   * 是否显示粗体
   * @default false
   */
  bold?: boolean
  /**
   * 一个用于区分多个图标的值,点击图标时通过`click`事件传出
   */
  index?: string | number
  /**
   * 图标按下去的样式类,用法同uni的`view`组件的`hover-class`参数,详见:[hover-class](https://uniapp.dcloud.io/component/view)
   */
  hoverClass?: string
  /**
   * 图标右侧/下方的label文字
   */
  label?: string | number
  /**
   * `label`相对于图标的位置
   * @default "right"
   */
  labelPos?: 'right' | 'bottom' | 'top' | 'left'
  /**
   * `label`字体大小,单位默认px
   * @default "15px"
   */
  labelSize?: string | number
  /**
   * `label`字体颜色
   * @default "color['u-content-color']"
   */
  labelColor?: string
  /**
   * `label`与图标的距离,单位默认px
   * @default "3px"
   */
  space?: string | number
  /**
   * 裁剪模式
   */
  imgMode?: ImageMode
  /**
   * `name`为图片路径时图片的宽度,单位默认px
   */
  width?: string | number
  /**
   * `name`为图片路径时图片的高度,单位默认px
   */
  height?: string | number
  /**
   * 图标到顶部的距离,如果某些场景,如果图标没有垂直居中,可以调整此参数,单位默认px
   * @default 0
   */
  top?: string | number
  /**
   * 是否阻止事件传播
   * @default false
   */
  stop?: boolean
  /**
   * 点击图标时触发
   * @param index 通过`props`传递的`index`值
   */
  onClick?: (index: any) => any
}
 
declare interface _Icon {
  new (): {
    $props: AllowedComponentProps &
      VNodeProps &
      IconProps
  }
}
 
export declare const Icon: _Icon