# calendar-plugin

> A Vue.js project

Latest version **1.0.1** (published 2017-03-22) · 0 weekly downloads

## Install

```sh
npm install calendar-plugin
pnpm add calendar-plugin
yarn add calendar-plugin
bun add calendar-plugin
```

## 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.0.1 |
| Published | 2017-03-22 |
| First published | 2017-03-22 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 4.0.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Author | oyh |
| Maintainers | reusjs |
| Keywords | calendar, Vue, html, js, es6, plugin |

## Links

- npm: https://www.npmjs.com/package/calendar-plugin
- Repository: https://github.com/Reusjs/calendar-plugin
- Issues: https://github.com/Reusjs/calendar-plugin/issues
- npm.io page: https://npm.io/package/calendar-plugin

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.1 (latest) — 2017-03-22
- 1.0.0 — 2017-03-22

## README

[预览](https://reusjs.github.io/calendar-plugin/)

# calendar-plugin

> A simple calender-plugin by Vue.js

## 使用方法

### 父组件可传props

```javascript
    props: {
        show: {   //是否显示组件
          type: Boolean,
          default: true
        },
        isRed: {  //红蓝两种主题可选
          type: Boolean,
          default: false
        },
        limit: {  //日期可选范围
          type: Object,
          default() {
            return {
              minYear: 1900,
              minMonth: 1,
              minDay: 1,
              maxYear: 2030,
              maxMonth: 3,
              maxDay: 20
            }
          }
        },
        showCalendar: {  //是否显示日历
          type: Boolean,
          default: true
        },
        containerStyle: { //组件容器样式
          type: Object
        }
      }
```

### 子组件向父组件传值方法

```javascript
  watch: {
    selectValue: function (newVal) {
      this.$emit('getValue', newVal);
    }
  },
  mounted() {
    this.$emit('getValue', this.selectValue);
  } 
```

### 在父组件中使用calendar-input
引入calendar-input, 如果父组件在vue-cli生成的components中，那么引用方法为：

```javascript
  import calendarInput from '../../node_modules/calendar-plugin/calendar-input.vue';
  export default {
    components: {
      calendarInput
    }
  }
```

如果父组件不在components中，就根据你的项目使用相对路径引入

使用并传递初始值，绑定子组件向父组件通信事件

```html
  <calendar-input :limit="limit" @getValue="getValue"></calendar-input>
```

使用红色主题

```html
  <calendar-input :isRed="true" @getValue="getValue"></calendar-input>
```

## Build Setup

``` bash
# install dependencies
npm install

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

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report
```

For detailed explanation on how things work, checkout the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).

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