# taro-week-swiper

> 按星期(每周)切换用于日期选择的小程序组件

Latest version **1.2.0-beta** (published 2021-03-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install taro-week-swiper
pnpm add taro-week-swiper
yarn add taro-week-swiper
bun add taro-week-swiper
```

## 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 | 1.2.0-beta |
| Published | 2021-03-01 |
| First published | 2019-07-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 10.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | zzzhan |
| Maintainers | zzzhan |

## Links

- npm: https://www.npmjs.com/package/taro-week-swiper
- Repository: https://github.com/zzzhan/taro-week-swiper
- Homepage: https://github.com/zzzhan/taro-week-swiper#readme
- Issues: https://github.com/zzzhan/taro-week-swiper/issues
- npm.io page: https://npm.io/package/taro-week-swiper

## Dependencies (8)

- [react](https://npm.io/package/react.md) ^16.10.0
- [moment](https://npm.io/package/moment.md) ^2.29.1
- [react-dom](https://npm.io/package/react-dom.md) ^16.10.0
- [@tarojs/taro](https://npm.io/package/@tarojs/taro.md) 3.0.22
- [@tarojs/react](https://npm.io/package/@tarojs/react.md) 3.0.22
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.7.7
- [@tarojs/runtime](https://npm.io/package/@tarojs/runtime.md) 3.0.22
- [@tarojs/components](https://npm.io/package/@tarojs/components.md) 3.0.22

## Recent versions

- 1.2.0-beta (latest) — 2021-03-01
- 1.1.0 — 2021-02-21
- 1.0.0 — 2019-07-01

## README

Taro Week Swiper
=========

> 基于Taro开发，按星期(每周)切换, 用于日期选择的小程序组件

## 示例截图

![示例截图](https://tva1.sinaimg.cn/large/008eGmZEgy1gnf3w4i6zfj30u01t077v.jpg)

## Feature

* 支持右左滑动切换星期
* 支持设置字体和背景颜色

## Getting Started

### Install

```
yarn add taro-week-swiper
# or
npm i taro-week-swiper --save
```

### Usage

```jsx
import Taro from '@tarojs/taro'
import { WeekSwiper } from 'taro-week-swiper'

class Code extends Taro.Component {
  constructor (props) {
    super(props)
    this.state = {selectedDate: ''}
  }
  onDayChange(selectedDate) {
    this.setState({selectedDate})
  }
  render () {
    const { selectedDate } = this.state
    return (
      <View className='index'>
        <WeekSwiper onChange={this.onDayChange.bind(this)}></WeekSwiper>
        <Text>选择日期:{selectedDate}</Text>
      </View>
    )
  }
}
```

### 参数

| 参数                       | 说明           | 类型    | 可选值 | 默认值  |
| :------------------------- | :------------- | :------ | :----- | :------ |
| date                 | 日期,格式为: YYYY-MM-DD       | String  | Yes      | 当天      | 
| backgroundColor                      | 背景色       | String  | Yes      | #19be6b       |
| color                      | 字体颜色       | String  | Yes      | #fff |

### 事件

| 事件名称 | 说明             | 返回参数   |
| :------- | :--------------- | :--------- |
| onChange   | 日期选择事件   | 日期字符串,格式为: YYYY-MM-DD |

### 注意

目前只在微信小程序测试，其他平台未测试

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