Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

95 wiersze
2.8 KiB

  1. import { defineMixin } from '../../libs/vue'
  2. import IconDefaultProps from './icon'
  3. import { registerComponentProps } from '../../libs/config/props.js'
  4. const defProps = registerComponentProps(IconDefaultProps)
  5. export const props = defineMixin({
  6. props: {
  7. // 图标类名
  8. name: {
  9. type: String,
  10. default: () => defProps.icon.name
  11. },
  12. // 图标颜色,可接受主题色
  13. color: {
  14. type: String,
  15. default: () => defProps.icon.color
  16. },
  17. // 字体大小,单位px
  18. size: {
  19. type: [String, Number],
  20. default: () => defProps.icon.size
  21. },
  22. // 是否显示粗体
  23. bold: {
  24. type: Boolean,
  25. default: () => defProps.icon.bold
  26. },
  27. // 点击图标的时候传递事件出去的index(用于区分点击了哪一个)
  28. index: {
  29. type: [String, Number],
  30. default: () => defProps.icon.index
  31. },
  32. // 触摸图标时的类名
  33. hoverClass: {
  34. type: String,
  35. default: () => defProps.icon.hoverClass
  36. },
  37. // 自定义扩展前缀,方便用户扩展自己的图标库
  38. customPrefix: {
  39. type: String,
  40. default: () => defProps.icon.customPrefix
  41. },
  42. // 图标右边或者下面的文字
  43. label: {
  44. type: [String, Number],
  45. default: () => defProps.icon.label
  46. },
  47. // label的位置,只能右边或者下边
  48. labelPos: {
  49. type: String,
  50. default: () => defProps.icon.labelPos
  51. },
  52. // label的大小
  53. labelSize: {
  54. type: [String, Number],
  55. default: () => defProps.icon.labelSize
  56. },
  57. // label的颜色
  58. labelColor: {
  59. type: String,
  60. default: () => defProps.icon.labelColor
  61. },
  62. // label与图标的距离
  63. space: {
  64. type: [String, Number],
  65. default: () => defProps.icon.space
  66. },
  67. // 图片的mode
  68. imgMode: {
  69. type: String,
  70. default: () => defProps.icon.imgMode
  71. },
  72. // 用于显示图片小图标时,图片的宽度
  73. width: {
  74. type: [String, Number],
  75. default: () => defProps.icon.width
  76. },
  77. // 用于显示图片小图标时,图片的高度
  78. height: {
  79. type: [String, Number],
  80. default: () => defProps.icon.height
  81. },
  82. // 用于解决某些情况下,让图标垂直居中的用途
  83. top: {
  84. type: [String, Number],
  85. default: () => defProps.icon.top
  86. },
  87. // 是否阻止事件传播
  88. stop: {
  89. type: Boolean,
  90. default: () => defProps.icon.stop
  91. }
  92. }
  93. })