You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

59 lines
1.8 KiB

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