云链智安app
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.

utils.js 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // 组件props
  2. export const props = {
  3. // 当前选中的值
  4. value: {
  5. type: Array,
  6. default: () => (['00', '00', '00', '00'])
  7. },
  8. // 标题
  9. title: {
  10. type: String,
  11. default: '时间'
  12. },
  13. // 取消按钮文字
  14. cancelText: {
  15. type: String,
  16. default: '取消'
  17. },
  18. // 取消按钮颜色
  19. canceColor: {
  20. type: String,
  21. default: '#666666'
  22. },
  23. // 确定按钮文字
  24. confirmText: {
  25. type: String,
  26. default: '确定'
  27. },
  28. // 确定按钮颜色
  29. confirmColor: {
  30. type: String,
  31. default: '#2bb781'
  32. },
  33. // 分割符
  34. segmentation: {
  35. type: String,
  36. default: '-'
  37. },
  38. // 设置选择器中间选中框的类名 注意页面或组件的style中写了scoped时,需要在类名前写/deep/
  39. indicatorClass: {
  40. type: String,
  41. default: 'picker-view__indicator'
  42. },
  43. // 设置选择器中间选中框的样式
  44. indicatorStyle: {
  45. type: String,
  46. default: ''
  47. },
  48. }
  49. // 滚动数据
  50. export let range = [
  51. [],
  52. [],
  53. [],
  54. []
  55. ];
  56. for (let i = 0; i < 24; i++) {
  57. range[0].push(i >= 10 ? String(i) : `0${i}`);
  58. range[2].push(i >= 10 ? String(i) : `0${i}`);
  59. }
  60. for (let i = 0; i < 60; i++) {
  61. range[1].push(i >= 10 ? String(i) : `0${i}`);
  62. range[3].push(i >= 10 ? String(i) : `0${i}`);
  63. }