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

vue-datepicker-scroll

v2.9.3

Published

移动端简约的可滑动组件,支持同时选择日期和时间。

Downloads

16

Readme

vue-datepicker-scroll

移动端简约的可滑动时间选择组件,支持同时选择日期和时间。

可以在GitHub中预览Demo效果,或者运行本项目。

Tips

该组件请在vue移动端使用,请先定义startDate和endDate变量(2019-11-11)格式的时间区间(也可以不传,分别为今天的前10天和后10天),最终返回的是时间格式的选中变量。具体参数请查看下方Options配置。

YYYY-MM-DD格式的时间,您可以使用dayjs或者moment.js格式化一下即可。

Install

npm install vue-datepicker-scroll

How to use?

1. 在main.js注册

// src/main.js
import Vue from 'vue'
import App from './App.vue'

import DatePickerScroll from "vue-datepicker-scroll";
Vue.use(DatePickerScroll)

···

2. 在组件中使用date-picker-scroll

// src/components/HelloWorld

<template>
  <div>
    <button @click="isPickerVisable=true">点击我选择</button>
    <p>{{selectedTime}}</p>

    <date-picker-scroll
      v-model="selectedTime"
      startDate="2019-11-10" // 不传的话为今天的前10天
      endDate="2019-11-25"   // 不传的话为今天的后10天
      :visible.sync="isPickerVisable"
      :onConfirm="handelConfirm"
    ></date-picker-scroll>

  </div>
</template>

<script>
export default {
  name: "HelloWorld",
  data() {
    return {
      isPickerVisable: false,
      selectedTime: new Date()
    };
  },
  methods: {
    handelConfirm(value) {
      this.selectedTime = value;
      console.log(this.selectedTime);
    }
  }
};
</script>

Options

| Option | Type | Defult | Comment | | ------------- | ------------- | ---------- |------------------- | | visible | Boolean | false | 显示或隐藏 默认:隐藏 | | cancelText | String | '取消' | 取消按钮文本 默认:取消 | | confirmText | String | '确认' | 确定按钮文本 默认:确认 | | titleText | String | '请选择' | 标题文本 默认:请选择 | | startDate | String | 今天的前10天 | YYYY-MM-DD 开始日期 默认:今天的前10天 格式:2019-11-11 | | endDate | String | 今天的后10天 | YYYY-MM-DD 结束日期 默认:今天的后10天 格式:2019-11-12 结束时间一定要大于等于开始时间 | | visibleCount | Number | 5 | 显示的个数 默认:5 | | value | Date | new Date() | 选中时间 默认:当前时间 | | onCancel | Function | null | 取消事件 | | onConfirm | Function | null | 确定事件 | | onChange | Function | null | 滑动元素变化事件 |

Need demo?

You can also run this project, get a simple demo.

npm install
npm run serve

You can open http://localhost:8080/ in your browser.

Contributing

Contributing Feel free to submit any fixes or propose any additional functionality via pull request or issue, making sure any changes take place in /src.

License

MIT