# vue-datepicker-scroll

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

Latest version **2.9.3** (published 2019-11-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-datepicker-scroll
pnpm add vue-datepicker-scroll
yarn add vue-datepicker-scroll
bun add vue-datepicker-scroll
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.9.3 |
| Published | 2019-11-14 |
| First published | 2019-11-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 4.8 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Elliotts Su |
| Maintainers | sulianggang |
| Keywords | vue, datepicker, date, picker |

## Links

- npm: https://www.npmjs.com/package/vue-datepicker-scroll
- Repository: https://github.com/Elliottssu/vue-datepicker-scroll
- Homepage: https://github.com/Elliottssu/vue-datepicker-scroll#readme
- Issues: https://github.com/Elliottssu/vue-datepicker-scroll/issues
- npm.io page: https://npm.io/package/vue-datepicker-scroll

## Dependencies (3)

- [vue](https://npm.io/package/vue.md) ^2.6.10
- [dayjs](https://npm.io/package/dayjs.md) ^1.8.17
- [core-js](https://npm.io/package/core-js.md) ^3.3.2

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 2.9.3 (latest) — 2019-11-14
- 2.9.2 — 2019-11-14
- 2.9.1 — 2019-11-13
- 2.9.0 — 2019-11-13
- 1.9.0 — 2019-11-13
- 1.8.0 — 2019-11-13
- 1.7.0 — 2019-11-13
- 1.6.0 — 2019-11-13
- 1.5.0 — 2019-11-13
- 1.4.0 — 2019-11-13
- 1.3.0 — 2019-11-13
- 1.2.0 — 2019-11-13
- 1.1.0 — 2019-11-12

## README

# vue-datepicker-scroll

<p>
  <a href="https://circleci.com/gh/vuejs/vue/tree/dev"><img src="https://img.shields.io/circleci/project/github/vuejs/vue/dev.svg" alt="Build Status"></a>
  <a href="https://www.npmjs.com/package/vue"><img src="https://img.shields.io/npm/v/vue.svg" alt="Version"></a>
  <a href="https://www.npmjs.com/package/vue"><img src="https://img.shields.io/npm/l/vue.svg" alt="License"></a>
</p>


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

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

## Tips

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

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

## Install

```bash
npm install vue-datepicker-scroll
```

## How to use?

### 1. 在main.js注册
```javascript
// 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
```javascript
// 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.

```bash
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](https://github.com/Elliottssu/vue-datepicker-scroll/blob/master/LICENSE)

---
_Source: https://npm.io/package/vue-datepicker-scroll · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
