props.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import { defineMixin } from '../../libs/vue'
  2. import defProps from '../../libs/config/props.js'
  3. export const props = defineMixin({
  4. props: {
  5. // input的label提示语
  6. label: {
  7. type: String,
  8. default: () => defProps.formItem.label
  9. },
  10. // 绑定的值
  11. prop: {
  12. type: String,
  13. default: () => defProps.formItem.prop
  14. },
  15. // 绑定的规则
  16. rules: {
  17. type: Array,
  18. default: () => defProps.formItem.rules
  19. },
  20. // 是否显示表单域的下划线边框
  21. borderBottom: {
  22. type: [String, Boolean],
  23. default: () => defProps.formItem.borderBottom
  24. },
  25. // label的位置,left-左边,top-上边
  26. labelPosition: {
  27. type: String,
  28. default: () => defProps.formItem.labelPosition
  29. },
  30. // label的宽度,单位px
  31. labelWidth: {
  32. type: [String, Number],
  33. default: () => defProps.formItem.labelWidth
  34. },
  35. // 右侧图标
  36. rightIcon: {
  37. type: String,
  38. default: () => defProps.formItem.rightIcon
  39. },
  40. // 左侧图标
  41. leftIcon: {
  42. type: String,
  43. default: () => defProps.formItem.leftIcon
  44. },
  45. // 是否显示左边的必填星号,只作显示用,具体校验必填的逻辑,请在rules中配置
  46. required: {
  47. type: Boolean,
  48. default: () => defProps.formItem.required
  49. },
  50. leftIconStyle: {
  51. type: [String, Object],
  52. default: () => defProps.formItem.leftIconStyle,
  53. }
  54. }
  55. })