props.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import defprops from '../../libs/config/props';
  2. export default {
  3. props: {
  4. // 是否为加载中状态
  5. loading: {
  6. type: Boolean,
  7. default: defprops.switch.loading
  8. },
  9. // 是否为禁用装填
  10. disabled: {
  11. type: Boolean,
  12. default: defprops.switch.disabled
  13. },
  14. // 开关尺寸,单位px
  15. size: {
  16. type: [String, Number],
  17. default: defprops.switch.size
  18. },
  19. // 打开时的背景颜色
  20. activeColor: {
  21. type: String,
  22. default: defprops.switch.activeColor
  23. },
  24. // 关闭时的背景颜色
  25. inactiveColor: {
  26. type: String,
  27. default: defprops.switch.inactiveColor
  28. },
  29. // 通过v-model双向绑定的值
  30. // #ifdef VUE3
  31. modelValue: {
  32. type: [Boolean, String, Number],
  33. default: defprops.switch.value
  34. },
  35. // #endif
  36. // #ifdef VUE2
  37. value: {
  38. type: [Boolean, String, Number],
  39. default: defprops.switch.value
  40. },
  41. // #endif
  42. // switch打开时的值
  43. activeValue: {
  44. type: [String, Number, Boolean],
  45. default: defprops.switch.activeValue
  46. },
  47. // switch关闭时的值
  48. inactiveValue: {
  49. type: [String, Number, Boolean],
  50. default: defprops.switch.inactiveValue
  51. },
  52. // 是否开启异步变更,开启后需要手动控制输入值
  53. asyncChange: {
  54. type: Boolean,
  55. default: defprops.switch.asyncChange
  56. },
  57. // 圆点与外边框的距离
  58. space: {
  59. type: [String, Number],
  60. default: defprops.switch.space
  61. }
  62. }
  63. }