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 🙏

© 2024 – Pkg Stats / Ryan Hefner

vuejs-mobile-datepicker

v1.1.7

Published

A Vue component to vuejs-mobile-datepicker

Downloads

10

Readme

Vue Component Plugin

A Vue component plugin to vuejs-mobile-datepicker

View

在线演示地址 demo (请用浏览器上切换到手机调试模式或在手机上体验)

Build Setup

# install
npm install vuejs-mobile-datepicker --save
// use
import DatePicker from 'vuejs-mobile-datepicker';
<template>
  <div id="app"> 
    <p @click="showDatePicker=true">点我打开</p>
    <date-picker
      language="en"
      :show-picker-model="showDatePicker"
      :mark-weekend="isMark"
      :start-date="new Date('1968-10-20')"
      :end-date="new Date('2020-12-31')"
      :disable-date="disableDate"
      @cancel="handleCancel"
      @confirm="handleConfirm"
    />
  </div>
</template>
export default {
  // ...
  components: {
    DatePicker
  },
  data(){
    return{
      isMark:true,
      showDatePicker:false,
      selectedDate:'',
    }
  },
  methods:{
    handleCancel() {
      this.showDatePicker = false;
    },
    handleConfirm(item) {
      this.selectedDate = item;
      this.showDatePicker = false;
    },
    disableDate(item) {
      if (
        new Date(item) - new Date("2019-8-10") >= 0 &&
        new Date("2019-8-20") - new Date(item) >= 0
      ) {
        return true;
      }
      return false;
    },
  }
  // ...
}

Property

| 名称 | 描述 | 类型 | 默认值 | 选项 | | ---- | ---- | ---- | ---- | ---- | | show-picker-model | 控制选择器显示或隐藏 | Boolean | false | true | false | mark-weekend | 是否标记周末 | Boolean | false | true | false | language | 语言 | String | "zh" | "zh" | "en" | default-date | 默认选中日期 | Date | new Date() | --- | start-date | 选择器最小可选日期 | Date | new Date('1900-1-1') | --- | end-date | 选择器最大可选日期 | Date | new Date() | --- | disable-date | 设置禁用日期,函数参数为需禁用日期如('2018-8-8'),要求返回Boolean值,为true禁用日期 | Function | --- | ---

Method

| 名称 | 描述 | 回调 | | ---- | ---- | ---- | | cancel | 取消按钮触发事件 | --- | | confirm | 确认按钮触发事件,回调参数为选中日期如("2018-8-8") | --- |

More

想了解更多关于该组件的源码,请移步到 我的博客

Github地址:https://github.com/J1ong/vuejs-mobile-datepicker