# vue-cron-2

> ![CocoaPods](https://img.shields.io/npm/dt/vue-cron-2.svg) ![CocoaPods](https://img.shields.io/npm/v/vue-cron-2.svg)

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

## Install

```sh
npm install vue-cron-2
pnpm add vue-cron-2
yarn add vue-cron-2
bun add vue-cron-2
```

## 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.7 |
| Published | 2019-11-14 |
| First published | 2019-03-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 504 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 7 |
| Maintainers | mennankose |
| Keywords | cron, vue, vuecron |

## Links

- npm: https://www.npmjs.com/package/vue-cron-2
- Repository: https://github.com/mennan/vue-cron
- Issues: https://github.com/mennan/vue-cron/issues
- npm.io page: https://npm.io/package/vue-cron-2

## Dependencies (4)

- [vue](https://npm.io/package/vue.md) 2.6.10
- [bootstrap](https://npm.io/package/bootstrap.md) ^4.3.1
- [vue-loader](https://npm.io/package/vue-loader.md) ^15.7.2
- [vue-multiselect](https://npm.io/package/vue-multiselect.md) ^2.1.6

## Recent versions

- 1.0.7 (latest) — 2019-11-14
- 1.0.6 — 2019-11-14
- 1.0.5 — 2019-11-13
- 1.0.4 — 2019-11-13
- 1.0.3 — 2019-03-13
- 1.0.2 — 2019-03-13

## README

# vue-cron

![CocoaPods](https://img.shields.io/npm/dt/vue-cron-2.svg)
![CocoaPods](https://img.shields.io/npm/v/vue-cron-2.svg)

这是一个 cron 表达式生成插件,基于 vue 与 element-ui 实现
[demo](https://1615450788.github.io/vue-cron/dist/index)

## 依赖

- Vue 2.0.0+
- element-ui 2.0.0+

## 安装方式

```
npm install vue-cron-2
```

## 引入方式

```javascript
//前置配置
import Vue from "vue";
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
Vue.use(ElementUI);

//全局引入
import VueCron from "vue-cron";
Vue.use(VueCron); //使用方式：<vueCron></vueCron>

//局部引入
import { cron } from "vue-cron";

export default {
  template: "<cron/>",
  components: { cron }
};
```

## 示例

```vue
<template>
  <div class="cron">
    <h1>vue-cron</h1>
    <el-popover v-model="cronPopover">
      <cron @change="changeCron" @close="cronPopover = false" i18n="en"></cron>
      <el-input
        slot="reference"
        @click="cronPopover = true"
        v-model="cron"
        placeholder="请输入定时策略"
      ></el-input>
    </el-popover>
  </div>
</template>

<script>
import { cron } from "vue-cron";

export default {
  components: { cron },
  data() {
    return {
      cronPopover: false,
      cron: ""
    };
  },
  methods: {
    changeCron(val) {
      this.cron = val;
    }
  }
};
</script>
```

在示例中我使用了 es6(es2015)语法,你可能需要引入 babel-polyfill 才能正常运行,或者你也可以用 es5 的写法

## 参数

- i18n

  - 参数 `{String} language` 目前仅支持`en|cn`

  国际化支持

## 事件

- change(cronText)

  - 参数：`{String} cronText` cron 表达式的值

  当 corn 表达式的值发生变化变化时触发

- close()

  - 参数：无

  当点击 corn 表达式选择框取消按钮时触发

## 大小

- 31.1k

## 联系方式

邮箱 : 1615450788@qq.com

有任何问题请发 Issues 或者邮箱联系我-.- 谢谢!

Forked from: https://github.com/1615450788/vue-cron

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