selectTime.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <div class="picker-body">
  3. <!--日期-->
  4. <div class="picker-day-box">
  5. <div class=" picker-day">
  6. <ul class="row">
  7. <li class="col-md-3 day" v-for="item in dayNamesA">
  8. <span>{{item}}</span><br>
  9. <small>{{item}}</small>
  10. </li>
  11. </ul>
  12. </div>
  13. </div>
  14. <!--时间-->
  15. <div></div>
  16. <button @click="dayList">时间</button>
  17. </div>
  18. </template>
  19. <script type="es6">
  20. export default {
  21. name: 'selectTime',
  22. data () {
  23. return {
  24. dayNamesA: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
  25. dayNamesB: '今天'
  26. }
  27. },
  28. methods: {
  29. dayList: function () {
  30. /* get currentMonthLenght */
  31. let currentMonthLength = new Date(this.tmpYear, this.tmpMonth + 1, 0).getDate()
  32. /* get currentMonth day */
  33. let daylist = Array.from({length: currentMonthLength}, (value, index) => {
  34. return index + 1
  35. })
  36. }
  37. }
  38. }
  39. </script>
  40. <style lang="less" scoped>
  41. .picker-body {
  42. position: relative;
  43. width: 100%;
  44. .picker-day-box {
  45. position: relative;
  46. height: 70px;
  47. padding-left: 10px;
  48. padding-right: 10px;
  49. background: #fff;
  50. .picker-day {
  51. overflow-x: auto;
  52. width: 100%;
  53. height: 72px;
  54. ul {
  55. min-width: 560px;
  56. transition: all .3s linear;
  57. margin-right: 0;
  58. margin-left: 0;
  59. li.day {
  60. text-align: center;
  61. display: block;
  62. font-size: 16px;
  63. padding: 10px;
  64. float: left;
  65. width: 70px;
  66. }
  67. li.day.on {
  68. color: #5689d6;
  69. }
  70. }
  71. }
  72. }
  73. }
  74. </style>