props.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. import { defineProps } from '../../libs/util/props';
  2. import theme from '../../libs/config/theme.js';
  3. export default defineProps('sidebar', {
  4. // 当前导航项的索引
  5. //#ifdef VUE2
  6. value: {
  7. type: [Number, String],
  8. default: 0,
  9. },
  10. // #endif
  11. // #ifdef VUE3
  12. // 当前导航项的索引
  13. modelValue: {
  14. type: [Number, String],
  15. default: 0,
  16. },
  17. // #endif
  18. // 宽度
  19. width: {
  20. type: String,
  21. default: '100px',
  22. },
  23. // 字体大小
  24. fontSize: {
  25. type: String,
  26. default: '14px',
  27. },
  28. // 行高
  29. lineHeight: {
  30. type: String,
  31. default: '22px',
  32. },
  33. // 文本颜色
  34. textColor: {
  35. type: String,
  36. default: theme.mainColor,
  37. },
  38. // 禁用文本颜色
  39. disabledColor: {
  40. type: String,
  41. default: theme.disabledColor,
  42. },
  43. // 禁用背景颜色
  44. disabledBgColor: {
  45. type: String,
  46. default: '',
  47. },
  48. // 背景色
  49. bgColor: {
  50. type: String,
  51. default: theme.bgColor,
  52. },
  53. // 激活时文本颜色
  54. activeColor: {
  55. type: String,
  56. default: theme.mainColor,
  57. },
  58. // 激活时背景颜色
  59. activeBgColor: {
  60. type: String,
  61. default: 'white',
  62. },
  63. // 激活时是否加粗
  64. activeBold: {
  65. type: Boolean,
  66. default: true,
  67. },
  68. // 激活时的样式
  69. activeStyle: {
  70. type: [String, Object],
  71. default: () => ({}),
  72. },
  73. // 非激活时的样式
  74. inactiveStyle: {
  75. type: [String, Object],
  76. default: () => ({}),
  77. },
  78. // 滑块长度
  79. lineWidth: {
  80. type: [String, Number],
  81. default: '4px',
  82. },
  83. // 滑块高度
  84. lineHeight: {
  85. type: [String, Number],
  86. default: '16px',
  87. },
  88. // 滑块颜色
  89. lineColor: {
  90. type: String,
  91. default: theme.primary,
  92. },
  93. // 滑块背景显示大小,当滑块背景设置为图片时使用
  94. lineBgSize: {
  95. type: String,
  96. default: 'cover',
  97. },
  98. showLine: {
  99. type: Boolean,
  100. default: true,
  101. },
  102. });