You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
2.7 KiB

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