3
0

props.js 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. import { defineMixin } from '../../libs/vue'
  2. import defProps from '../../libs/config/props.js'
  3. export const props = defineMixin({
  4. props: {
  5. // 是否展示modal
  6. show: {
  7. type: Boolean,
  8. default: () => defProps.modal.show
  9. },
  10. // 标题
  11. title: {
  12. type: [String],
  13. default: () => defProps.modal.title
  14. },
  15. // 弹窗内容
  16. content: {
  17. type: String,
  18. default: () => defProps.modal.content
  19. },
  20. // 确认文案
  21. confirmText: {
  22. type: String,
  23. default: () => defProps.modal.confirmText
  24. },
  25. // 取消文案
  26. cancelText: {
  27. type: String,
  28. default: () => defProps.modal.cancelText
  29. },
  30. // 是否显示确认按钮
  31. showConfirmButton: {
  32. type: Boolean,
  33. default: () => defProps.modal.showConfirmButton
  34. },
  35. // 是否显示取消按钮
  36. showCancelButton: {
  37. type: Boolean,
  38. default: () => defProps.modal.showCancelButton
  39. },
  40. // 确认按钮颜色
  41. confirmColor: {
  42. type: String,
  43. default: () => defProps.modal.confirmColor
  44. },
  45. // 取消文字颜色
  46. cancelColor: {
  47. type: String,
  48. default: () => defProps.modal.cancelColor
  49. },
  50. // 对调确认和取消的位置
  51. buttonReverse: {
  52. type: Boolean,
  53. default: () => defProps.modal.buttonReverse
  54. },
  55. // 是否开启缩放效果
  56. zoom: {
  57. type: Boolean,
  58. default: () => defProps.modal.zoom
  59. },
  60. // 是否异步关闭,只对确定按钮有效
  61. asyncClose: {
  62. type: Boolean,
  63. default: () => defProps.modal.asyncClose
  64. },
  65. // 是否允许点击遮罩关闭modal
  66. closeOnClickOverlay: {
  67. type: Boolean,
  68. default: () => defProps.modal.closeOnClickOverlay
  69. },
  70. // 给一个负的margin-top,往上偏移,避免和键盘重合的情况
  71. negativeTop: {
  72. type: [String, Number],
  73. default: () => defProps.modal.negativeTop
  74. },
  75. // modal宽度,不支持百分比,可以数值,px,rpx单位
  76. width: {
  77. type: [String, Number],
  78. default: () => defProps.modal.width
  79. },
  80. // 确认按钮的样式,circle-圆形,square-方形,如设置,将不会显示取消按钮
  81. confirmButtonShape: {
  82. type: String,
  83. default: () => defProps.modal.confirmButtonShape
  84. },
  85. // 文案对齐方式
  86. contentTextAlign: {
  87. type: String,
  88. default: () => defProps.modal.contentTextAlign
  89. },
  90. }
  91. })