代码拉取完成,页面将自动刷新
同步操作将从 ldang264/vue-cron-generator 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
使用的项目
👉 Attemper: 分布式多租户的支持流程编排的任务调度平台(用之作为cron表达式生成器) 👈
npm install vue-cron-generator
import Vue from 'vue'
import VueI18n from 'vue-i18n'
import elementEnLocale from 'element-ui/lib/locale/lang/en' // element-ui lang
import elementZhLocale from 'element-ui/lib/locale/lang/zh-CN'// element-ui lang
import cronEnLocale from 'vue-cron-generator/src/locale/en'
import cronZhLocale from 'vue-cron-generator/src/locale/zh-CN'
Vue.use(VueI18n)
const messages = {
en: {
...elementEnLocale,
...cronEnLocale
},
zh: {
...elementZhLocale,
...cronZhLocale
}
}
const i18n = new VueI18n({
// set locale
// options: en | zh
locale: 'en',
// set locale messages
messages
})
export default i18n
import Vue from 'vue'
import Element from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import 'vue-cron-generator/src/styles/global.less'
import App from './App'
import i18n from './lang' // Internationalization
Vue.use(Element, {
size: localStorage.getItem('size') || 'small', // set element-ui default size
i18n: (key, value) => i18n.t(key, value)
})
new Vue({
el: '#app',
i18n,
render: h => h(App)
})
<template>
<div id="app">
<el-row>
<el-col :span="6" :offset="9">
<cron-input v-model="cron" @change="change" @reset="reset"/>
</el-col>
</el-row>
</div>
</template>
<script>
import CronInput from 'vue-cron-generator/src/components/cron-input'
import { DEFAULT_CRON_EXPRESSION } from 'vue-cron-generator/src/constant/filed'
export default {
name: 'App',
components: {
CronInput
},
data() {
return {
cron: DEFAULT_CRON_EXPRESSION
}
},
methods: {
change(cron) {
this.cron = cron
},
reset(cron) {
this.cron = DEFAULT_CRON_EXPRESSION
}
}
}
</script>
<style lang="less">
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>
# 下载依赖
npm install vue-cron-generator
# 服务启动在localhost:8080
npm run dev
# 构建生产文件
npm run build
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。