date-picker.vue
1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<template>
<div class="comp">
<div class="date-wrap">
<div class="calendar-wrap">
<!-- 标题 -->
<div class="nav-wrap">
<div class="date-wrap">
<div class="pointer nav-btn" @click="prevMonth">
<img src="@/assets/images/form/date-picker/data-picker-icon-up.png">
</div>
<div class="date">
<span class="pointer">{{year}}年{{month}}月</span>
</div>
<div class="pointer nav-btn" @click="nextMonth">
<img src="@/assets/images/form/date-picker/data-picker-icon-down.png">
</div>
</div>
</div>
<!-- 日历躯干 -->
<div class="con">
<!-- 日历表头 -->
<div class="th tr">
<div class="td" :class="{'disable':!weekend}">日</div>
<div class="td">一</div>
<div class="td">二</div>
<div class="td">三</div>
<div class="td">四</div>
<div class="td">五</div>
<div class="td" :class="{'disable':!weekend}">六</div>
</div>
<!-- 日历主体 -->
<div class="tr">
<div class="td" v-for="(item,index) in fortmatMonthData" :key="index">
<div @click="selectDay(item.disable ? null : item)" v-if="item && item.date" class="pointer point" :class="{'sel':item && item.date && item.date == date,'disable':item.disable}">
<div>{{item && item.date || ""}}</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script src="./date-picker.js"></script>
<style lang="scss" scoped>
@import "./date-picker.scss";
</style>