云链智安app
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

utils2.js 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // 组件props
  2. 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. 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. }
  64. export default {
  65. props,
  66. range
  67. }