component.scheme.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. export const propsScheme = {
  2. type: {
  3. type: String,
  4. intro: '菜单按钮类型,同 Button 组件一样,仅在 split-button 为 true 的情况下有效',
  5. attr: true
  6. },
  7. size: {
  8. type: String,
  9. intro: '菜单尺寸,在 split-button 为 true 的情况下也对触发按钮生效',
  10. options: ['large', 'default', 'small'],
  11. default: 'default',
  12. validate: true,
  13. attr: true
  14. },
  15. maxHeight: {
  16. type: [String, Number],
  17. intro: '菜单最大高度',
  18. attr: true
  19. },
  20. splitButton: {
  21. type: Boolean,
  22. intro: '下拉触发元素呈现为按钮组',
  23. default: false,
  24. attr: true
  25. },
  26. disabled: {
  27. type: Boolean,
  28. intro: '是否禁用',
  29. default: false,
  30. attr: true
  31. },
  32. placement: {
  33. type: String,
  34. intro: '菜单弹出位置',
  35. options: ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end'],
  36. default: 'bottom',
  37. validate: true,
  38. attr: true
  39. },
  40. trigger: {
  41. type: String,
  42. intro: '触发下拉的行为',
  43. options: ['hover', 'click', 'contextmenu'],
  44. default: 'hover',
  45. validate: true,
  46. attr: true
  47. },
  48. hideOnClick: {
  49. type: Boolean,
  50. intro: '是否在点击菜单项后隐藏菜单',
  51. default: true,
  52. attr: true
  53. },
  54. showTimeout: {
  55. type: Number,
  56. intro: '展开下拉菜单的延时,仅在 trigger 为 hover 时有效',
  57. default: 250,
  58. attr: true
  59. },
  60. hideTimeout: {
  61. type: Number,
  62. intro: '收起下拉菜单的延时(仅在 trigger 为 hover 时有效)',
  63. default: 150,
  64. attr: true
  65. },
  66. role: {
  67. type: String,
  68. intro: '下拉菜单的 ARIA 属性。 根据具体场景,您可能想要将此更改为“navigation”',
  69. default: 'menu',
  70. attr: true
  71. },
  72. tabindex: {
  73. type: Number,
  74. intro: 'Dropdown 组件的 tabindex',
  75. default: 0,
  76. attr: true
  77. },
  78. popperClass: {
  79. type: String,
  80. intro: '自定义浮层类名',
  81. attr: true
  82. },
  83. popperOptions: {
  84. type: Object,
  85. intro: 'popper.js 参数, 请参考 popper.js 文档',
  86. default: { boundariesElement: 'body', gpuAcceleration: false },
  87. attr: true
  88. }
  89. }
  90. export const slotsScheme = {
  91. default: {
  92. intro: '下拉菜单的内容。 注意:必须是有效的 html DOM 元素(例如 <span>、<button> 等)或 el-component,以附加监听触发器'
  93. },
  94. dropdown: {
  95. intro: '下拉列表,通常是 <el-dropdown-menu> 组件'
  96. }
  97. }
  98. export const componentScheme = {
  99. propsScheme,
  100. slotsScheme
  101. }