props.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. import { defineProps } from '../../libs/util/props';
  2. import theme from '../../libs/config/theme.js'
  3. export default defineProps('subsection', {
  4. // tab的数据
  5. list: {
  6. type: Array,
  7. default: () => []
  8. },
  9. // 当前活动的tab的index
  10. current: {
  11. type: [String, Number],
  12. default: 0
  13. },
  14. // 激活的颜色
  15. activeColor: {
  16. type: String,
  17. default: theme.primary
  18. },
  19. // 未激活的颜色
  20. inactiveColor: {
  21. type: String,
  22. default: theme.contentColor
  23. },
  24. // 模式选择,mode=button为按钮形式,mode=subsection时为分段模式
  25. mode: {
  26. type: String,
  27. default: 'button'
  28. },
  29. // 字体大小
  30. fontSize: {
  31. type: [String, Number],
  32. default: 12
  33. },
  34. // 激活tab的字体是否加粗
  35. bold: {
  36. type: Boolean,
  37. default: true
  38. },
  39. // mode = button时,组件背景颜色
  40. bgColor: {
  41. type: String,
  42. default: theme.bgColor
  43. },
  44. // 从list元素对象中读取的键名
  45. keyName: {
  46. type: String,
  47. default: 'name'
  48. },
  49. shape: {
  50. type: String,
  51. default: 'square'
  52. },
  53. height: {
  54. type: [String, Number],
  55. default: 30
  56. },
  57. barColor: {
  58. type: String,
  59. default: ''
  60. },
  61. disabled: {
  62. type: Boolean,
  63. default: false
  64. },
  65. disabledBgColor: {
  66. type: String,
  67. default: '#e5e5e5'
  68. },
  69. disabledColor: {
  70. type: String,
  71. default: theme.disabledColor
  72. }
  73. })