component.scheme.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. import { defaultButtonConfigMap } from './config'
  2. export const propsScheme = {
  3. buttonType: {
  4. type: String,
  5. options: Object.keys(defaultButtonConfigMap),
  6. intro: '预设按钮类型'
  7. },
  8. size: {
  9. type: String,
  10. default: 'default',
  11. intro: '大小',
  12. options: ['small', 'default', 'large'],
  13. validate: true,
  14. attr: true
  15. },
  16. icon: {
  17. type: [String, Object, Function],
  18. intro: '图标类名/组件'
  19. },
  20. type: {
  21. type: String,
  22. intro: '按钮类型',
  23. options: ['default', 'primary', 'info', 'warning', 'danger', 'success'],
  24. validate: true,
  25. attr: true
  26. },
  27. map: {
  28. type: Boolean,
  29. intro: '是否地图按钮'
  30. },
  31. plain: {
  32. type: Boolean,
  33. intro: '是否朴素按钮',
  34. attr: true
  35. },
  36. round: {
  37. type: Boolean,
  38. intro: '是否圆角按钮',
  39. attr: true
  40. },
  41. circle: {
  42. type: Boolean,
  43. intro: '是否圆形按钮',
  44. attr: true
  45. },
  46. square: {
  47. type: Boolean,
  48. intro: '是否方形按钮'
  49. },
  50. loading: {
  51. type: Boolean,
  52. intro: '是否加载中状态',
  53. attr: true
  54. },
  55. disabled: {
  56. type: Boolean,
  57. intro: '是否禁用状态',
  58. attr: true
  59. }
  60. }
  61. export const eventsScheme = {
  62. click: {
  63. cbVar: 'e'
  64. }
  65. }
  66. export const slotsScheme = {
  67. default: {
  68. cbVar: 'text'
  69. }
  70. }
  71. export const componentScheme = {
  72. propsScheme,
  73. slotsScheme,
  74. eventsScheme
  75. }