# vue-period

> Vue-based time selection component

Latest version **0.0.4** (published 2017-06-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-period
pnpm add vue-period
yarn add vue-period
bun add vue-period
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2017-06-07 |
| First published | 2017-06-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | savoygu |
| Maintainers | savoygu |
| Keywords | vue, vue-period, period, components |

## Links

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

## Dependencies (2)

- [vue](https://npm.io/package/vue.md) ^2.3.3
- [element-ui](https://npm.io/package/element-ui.md) ^1.3.5

## Recent versions

- 0.0.4 (latest) — 2017-06-07
- 0.0.3 — 2017-06-07
- 0.0.2 — 2017-06-07

## README

# vue-period

> Vue-based time selection component

## Screenshots

![vue-period](screenshot/period.gif)

## Install

Get source from npm or yarn.

``` bash
# Npm
$ npm install vue-period --save

# Yarn (recommend)
$ yarn add vue-period
```

Support UMD library and individual CSS file.

```bash
./lib/
├── vue-period.js
└── vue-period.css
./src/
├── /components/
│   ├── period.vue
│   └── period-part.vue
├── /util/
│   └── util.js
└── index.js
```

```javascript
// For ES6 module
import Period from 'vue-period'

// Import from src code for debugging or self building
import Period from 'vue-period/src';
```

And import CSS file:
```javascript
require('vue-period/lib/vue-period.css');
```


## Usage

```template
<template>
    <div id="app">
        <period
            :initStatus="[{ day: 1, start: 6, end: 10 }, { day: 2, start: 13, end: 13 }]"
            :isFormat="true"
            :customProperty="{ day: 'weekday', start: 'startHour', end: 'endHour' }"
            :periodClass="[]"
            @change="handleChange">
        </period>
    </div>
</template>
```

```javascript
export default {
    name: 'app',
    data () {
      return {
        week: []
      }
    },
    methods: {
      handleChange (week) {
        this.week = week
      }
    }
}
```


## API

Props

| Property | Description | Type | Default |
| ----- | ----- | ----- | ----- |
| initStatus | Initialize unselected boxes. | Array | [] |
| isFormat | Format the returned data. | Boolean | true |
| customProperty | Customize the key value for the returned data | Object | {day: 'day', start: 'start', end: 'end'} |
| periodClass | Custom style | String/Array/Object | - |

Events

| Event Name | Description | Return Value |
| ----- | ----- | ----- |
| change | Callback when clicking button or boxes. | [{day: '', start: '', end: ''}] |


## Build Setup

``` bash
# install dependencies
npm install / yarn install

# serve with hot reload at localhost:8080
npm run demo:dev

# build for demo with minification
npm run demo:build

# build for gh-pages with minification
npm run demo:prepublish

# build for production with minification
npm run build
```


# TODO

- [ ] Remove the dependency on element-ui



## License

MIT

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