npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

vue-calendar-switch

v1.0.3

Published

选择日期区间的Vue组件

Readme

vue-calendar-switch

移动端区间日期选择器

描述

次组件可以选择起始日期,第一次点击为开始时间,第二次点击为结束时间。可以跨月份选择,跨年分选择。 支持个性化配置如: 最大选择区间、 是否开启动画效果、 限制区间选择范围天数、 是否开启周六日禁止点击、 禁用的日期

演示

vue-calendar-switch

安装

npm install vue-calendar-switch

引用


//main.js
import calendarSwitch from 'vue-calendar-switch'

Vue.prototype.$calendarSwitch = calendarSwitch;

使用

<input type="text" placeholder="请选择日期区间" ref="calendar" unselectable="on" onfocus="this.blur()" readonly="readonly" class="inputstyle" v-model="appoint_datetime">
//methods中使用
initCalendar() {
	this.$calendarSwitch({
		element: this.$refs.calendarTigger,
		monthSize: 2,
		minDate: '2019-12-01',
		maxDate: '2020-05-03',
		onSuccess: (data) => {
			this.dateSpace = data.start_date +'~'+ data.end_date;
			console.log(this.dateSpace);
		},
		onError: function(msg) {
			console.log(msg)
		}
	});
}

参数

| 参数 | 说明 | | ------------- |-------------| | element |[Object], 文本框对象 | | monthSize | [Number],展示的月份个数,默认4个 | | showEffect | [String]:开启动画效果,默认'slideInBottom' | | limitSection | [Number] 限制区间选择范围天数 0:不限制,大于0是限制多少天 | | weekDisabled | [Boolean] 是否开启周六日禁止点击, 默认false 关闭 | | startDate | [String] 开始时间 | | endDate | [String] 结束时间 | | minDate | [String] 选择范围:最小时间 | | maxDate | [String] 选择范围:最大时间(最大范围时间要出现在monthSize月份之中) | | disabledDate | [Array] 手动设置禁用的日期 |

回调

| 参数 | 说明 | | ------------- |-------------| | onSuccess | [Function] 成功回调 | | onError | [Function] 错误回调 |