date-picker.vue 1.49 KB

<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>