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.
 
 
 

51 lines
1.6 KiB

  1. import { defineMixin } from '../../libs/vue'
  2. import FormDefaultProps from './form'
  3. import { registerComponentProps } from '../../libs/config/props.js'
  4. const defProps = registerComponentProps(FormDefaultProps)
  5. export const props = defineMixin({
  6. props: {
  7. // 当前form的需要验证字段的集合
  8. model: {
  9. type: Object,
  10. default: () => defProps.form.model
  11. },
  12. // 验证规则
  13. rules: {
  14. type: [Object, Function, Array],
  15. default: () => defProps.form.rules
  16. },
  17. // 有错误时的提示方式,message-提示信息,toast-进行toast提示
  18. // border-bottom-下边框呈现红色,none-无提示
  19. errorType: {
  20. type: String,
  21. default: () => defProps.form.errorType
  22. },
  23. // 是否显示表单域的下划线边框
  24. borderBottom: {
  25. type: Boolean,
  26. default: () => defProps.form.borderBottom
  27. },
  28. // label的位置,left-左边,top-上边
  29. labelPosition: {
  30. type: String,
  31. default: () => defProps.form.labelPosition
  32. },
  33. // label的宽度,单位px
  34. labelWidth: {
  35. type: [String, Number],
  36. default: () => defProps.form.labelWidth
  37. },
  38. // lable字体的对齐方式
  39. labelAlign: {
  40. type: String,
  41. default: () => defProps.form.labelAlign
  42. },
  43. // lable的样式,对象形式
  44. labelStyle: {
  45. type: Object,
  46. default: () => defProps.form.labelStyle
  47. }
  48. }
  49. })