props.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. import { defineProps } from '../../libs/util/props';
  2. import theme from '../../libs/config/theme.js';
  3. export default defineProps('modal', {
  4. // 是否展示modal
  5. show: {
  6. type: Boolean,
  7. default: false
  8. },
  9. // 标题
  10. title: {
  11. type: [String],
  12. default: ''
  13. },
  14. // 弹窗内容
  15. content: {
  16. type: String,
  17. default: ''
  18. },
  19. // 确认文案
  20. confirmText: {
  21. type: String,
  22. default: () => uni.$u.$t('uModal.confirmText')
  23. },
  24. // 取消文案
  25. cancelText: {
  26. type: String,
  27. default: () => uni.$u.$t('uModal.cancelText')
  28. },
  29. // 是否显示确认按钮
  30. showConfirmButton: {
  31. type: Boolean,
  32. default: true
  33. },
  34. // 是否显示取消按钮
  35. showCancelButton: {
  36. type: Boolean,
  37. default: false
  38. },
  39. // 确认按钮颜色
  40. confirmColor: {
  41. type: String,
  42. default: theme.primary
  43. },
  44. // 取消文字颜色
  45. cancelColor: {
  46. type: String,
  47. default: theme.contentColor
  48. },
  49. // 对调确认和取消的位置
  50. buttonReverse: {
  51. type: Boolean,
  52. default: false
  53. },
  54. // 确认按钮背景颜色
  55. confirmBgColor: {
  56. type: String,
  57. default: theme.primary
  58. },
  59. // 取消按钮背景颜色
  60. cancelBgColor: {
  61. type: String,
  62. default: theme.infoLight
  63. },
  64. // 确认按钮圆角
  65. buttonRound: {
  66. type: String,
  67. default: '100px'
  68. },
  69. // 按钮模式
  70. buttonModel: {
  71. type: String,
  72. default: 'text'
  73. },
  74. // 是否开启缩放效果
  75. zoom: {
  76. type: Boolean,
  77. default: true
  78. },
  79. // 层级
  80. zIndex: {
  81. type: [String, Number],
  82. default: 10075
  83. },
  84. // 是否异步关闭,只对确定按钮有效
  85. asyncClose: {
  86. type: Boolean,
  87. default: false
  88. },
  89. // 是否允许点击遮罩关闭modal
  90. closeOnClickOverlay: {
  91. type: Boolean,
  92. default: false
  93. },
  94. // 给一个负的margin-top,往上偏移,避免和键盘重合的情况
  95. negativeTop: {
  96. type: [String, Number],
  97. default: 0
  98. },
  99. // modal宽度,不支持百分比,可以数值,px,rpx单位
  100. width: {
  101. type: [String, Number],
  102. default: '650rpx'
  103. },
  104. // 确认按钮的样式,circle-圆形,square-方形,如设置,将不会显示取消按钮
  105. confirmButtonShape: {
  106. type: String,
  107. default: ''
  108. },
  109. // 弹窗动画过度时间
  110. duration: {
  111. type: [String, Number],
  112. default: 200
  113. },
  114. // 设置圆角值
  115. round: {
  116. type: String,
  117. default: '6px'
  118. }
  119. })