component.scheme.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. export const propsScheme = {
  2. message: {
  3. type: String,
  4. intro: '消息文字'
  5. },
  6. type: {
  7. type: String,
  8. options: ['success', 'warning', 'info', 'error'],
  9. default: 'info',
  10. validate: true,
  11. intro: '消息类型'
  12. },
  13. showClose: {
  14. type: Boolean,
  15. intro: '是否显示关闭按钮',
  16. default: false,
  17. attr: true
  18. },
  19. grouping: {
  20. type: Boolean,
  21. intro: '合并内容相同的消息,不支持 VNode 类型的消息',
  22. default: false,
  23. attr: true
  24. },
  25. icon: {
  26. type: String,
  27. intro: '自定义图标,该属性会覆盖 type 的图标。',
  28. attr: true
  29. },
  30. dangerouslyUseHTMLString: {
  31. type: Boolean,
  32. intro: '是否将 message 属性作为 HTML 片段处理',
  33. default: false,
  34. attr: true
  35. },
  36. customClass: {
  37. type: String,
  38. intro: '自定义类名',
  39. attr: true
  40. },
  41. duration: {
  42. type: Number,
  43. intro: '显示时间,单位为毫秒。 设为 0 则不会自动关闭',
  44. default: 3000,
  45. attr: true
  46. },
  47. center: {
  48. type: Boolean,
  49. intro: '文字是否居中',
  50. default: false,
  51. attr: true
  52. },
  53. onClose: {
  54. type: Function,
  55. intro: '关闭时的回调函数, 参数为被关闭的 message 实例',
  56. attr: true
  57. },
  58. offset: {
  59. type: Number,
  60. intro: 'Message 距离窗口顶部的偏移量',
  61. default: 20,
  62. attr: true
  63. },
  64. appendTo: {
  65. type: [String, HTMLElement],
  66. intro: '设置组件的根元素',
  67. default: 'document.body',
  68. attr: true
  69. }
  70. }
  71. export const componentScheme = {
  72. propsScheme
  73. }