1.0.3 • Published 9 months ago

vue2-calendar-cc v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

calendar

一个 vue2 的简单日历组件

支持的功能

  • 月份切换
  • 年份切换
  • 高亮指定日期
  • 黑夜模式

Alt text

Alt text

props

名称类型默认值说明
widthNumber/String'600px'日历的宽度
highlightNumber/String''日历的高度
themeString''主题颜色(可选'dark')
currentTimeString系统年月日初始化的时间(xxxx-xx-xx)
autoMonthSwitchBooleantrue点击非当前月日期,是否自动跳转到目标月份

events

名称说明
changechange(item),切换日期时的回调事件
dateClickdateClick(item),点击日期时的回调事件

slot

名称说明
header日历头部的插槽

methods

名称说明
prevMonth切换到上一个月
nextMonth切换到下一个月
prevYear切换到上一年
nextYear切换到下一年
backToToday切换到今天(受 currentTime 影响)

Project Setup

npm i vue2-calendar-cc

使用方法

<template>
	<div>
		<Calendar width="600px" theme="dark" :currentTime.sync="currentTime"></Calendar>
	</div>
</template>

<script>
import Calendar from 'vue2-calendar-cc';
export default {
	components: {
		Calendar,
	},
	data() {
		return {
			currentTime: '2023-01-01',
		};
	},
};
</script>

<style>
@import url('../node_modules/vue2-calendar-cc/dist/style.css');
</style>
1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago