props.js 1.3 KB

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