props.js 1.2 KB

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