Skip to content

Commit c1c73b9

Browse files
committed
docs: add documentation for @vue-js-cron/light
1 parent 841e7d5 commit c1c73b9

File tree

8 files changed

+122
-15
lines changed

8 files changed

+122
-15
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Read the [docs](https://abichinger.github.io/vue-js-cron/)
1515
This monorepo includes the following packages:
1616

1717
- core - a renderless Vue.js component to generate cron expressions.
18+
- light - a lightweight cron editor without external dependencies
1819
- vuetify - Vuetify component to edit cron expressions.
1920
- docs - Vue.js Cron documentation with [VuePress](https://vuepress.vuejs.org/)
2021

docs/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"vuepress": "^1.8.2"
1919
},
2020
"dependencies": {
21-
"@vue-js-cron/core": "1.0.0",
22-
"@vue-js-cron/vuetify": "1.0.1"
21+
"@vue-js-cron/core": "2.0.0",
22+
"@vue-js-cron/light": "^1.0.0",
23+
"@vue-js-cron/vuetify": "2.0.0"
2324
}
2425
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<template>
2+
<div class="getting-started-light">
3+
<div>{{value}}</div>
4+
<CronLight v-model="value" @error="error=$event"></CronLight>
5+
</div>
6+
</template>
7+
8+
<script>
9+
export default {
10+
data() {
11+
return {
12+
value: '30 12,19 24 12 *',
13+
error: ''
14+
}
15+
},
16+
methods:{
17+
18+
}
19+
}
20+
</script>
21+
22+
<style scoped>
23+
24+
.getting-started-light > div {
25+
margin-top: 10px;
26+
margin-bottom: 6px;
27+
}
28+
29+
</style>

docs/src/.vuepress/config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ module.exports = {
7070
'core',
7171
]
7272
},
73+
{
74+
title: 'Light',
75+
collapsable: false,
76+
children: [
77+
'light',
78+
]
79+
},
7380
{
7481
title: 'Vuetify',
7582
collapsable: false,

docs/src/.vuepress/enhanceApp.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import CronCore from '@vue-js-cron/core'
22
import CronVuetify from '@vue-js-cron/vuetify'
3+
import '@vue-js-cron/vuetify/dist/vuetify.css'
34
import Vuetify from "vuetify";
45
import "vuetify/dist/vuetify.min.css";
5-
import '@vue-js-cron/vuetify/dist/vuetify.css'
6+
import CronLight from '@vue-js-cron/light'
7+
import '@vue-js-cron/light/dist/light.css'
68

79
export default ({
810
Vue, // the version of Vue being used in the VuePress app
@@ -14,4 +16,5 @@ export default ({
1416
options.vuetify = new Vuetify({})
1517
Vue.use(CronCore);
1618
Vue.use(CronVuetify);
19+
Vue.use(CronLight)
1720
}

docs/src/api/light.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# CronLight - Component
2+
3+
## Props
4+
5+
<api-core-props>
6+
<template v-slot:r1c2>
7+
8+
<<< @/src/api/default/fields.js
9+
10+
</template>
11+
<template v-slot:r2c2>
12+
13+
<<< @/src/api/default/periods.js
14+
15+
</template>
16+
<template v-slot:r4c2>
17+
18+
[en.js](https://github.com/abichinger/vue-js-cron/blob/main/core/src/locale/en.js)
19+
20+
</template>
21+
</api-core-props>
22+
23+
### Types
24+
25+
<<< @/src/api/types/field.ts
26+
27+
<<< @/src/api/types/period.ts
28+
29+
<<< @/src/api/types/locale.ts
30+
31+
## Events
32+
33+
<api-core-events />

docs/src/guide/getting-started.md

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,51 @@
11
# Getting Started
22

3-
The fastest way to get a component, which can generate cron expression, is to install one of the prebuilt components.
4-
For now Vue-js-cron provides a prebuilt component for [Vuetify.js](/guide/getting-started.html#quick-start-vuetify).
5-
If you would like to use a different UI framework, follow the quick start guide on how to use the renderless component.
3+
The fastest way to get started, is to install one of the prebuilt components.
4+
For now `vue-js-cron` provides the following prebuilt components:
5+
- [CronLight](#quick-start-cronlight) - a lightweight cron editor without external dependencies
6+
- [CronVuetify](#quick-start-cronvuetify) - a cron editor for [Vuetify.js](/guide/getting-started.html#quick-start-vuetify).
67

7-
## Quick Start - Vuetify
8+
If you would like to use a different UI framework, follow the quick start guide on how to use the [renderless component](#quick-start-renderless).
9+
10+
## Quick Start - CronLight
11+
12+
#### Installation
13+
14+
Open up a terminal and run the following command:
15+
16+
```bash
17+
yarn add @vue-js-cron/light
18+
```
19+
or
20+
21+
```bash
22+
npm install @vue-js-cron/light
23+
```
24+
#### Usage
25+
26+
Then you need to register `vue-js-cron/light` with `Vue.use()`
27+
28+
```js
29+
import cronLight from '@vue-js-cron/light'
30+
import '@vue-js-cron/light/dist/light.css'
31+
Vue.use(cronLight)
32+
```
33+
34+
Now you can use the component `CronLight`.
35+
36+
#### Code
37+
38+
<<< @/src/.vuepress/components/getting-started-light.vue
39+
40+
#### Result
41+
42+
<getting-started-light />
43+
44+
#### API
45+
46+
- [CronLight](../api/light)
47+
48+
## Quick Start - CronVuetify
849

950
#### Installation
1051

yarn.lock

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2026,14 +2026,6 @@
20262026
dependencies:
20272027
"@types/yargs-parser" "*"
20282028

2029-
"@vue-js-cron/vuetify@1.0.1":
2030-
version "1.0.1"
2031-
resolved "https://registry.yarnpkg.com/@vue-js-cron/vuetify/-/vuetify-1.0.1.tgz#cdca9e457f8776f4bb03124fe0bba7d9f5153685"
2032-
integrity sha512-gbR5FYmUR2u5FS91hC57THvEp8/OE26QWquV/0KVvaCIjvNLI7BKXf0ncMNbbT85yewG1mBLTOMBCwJW0e1QwA==
2033-
dependencies:
2034-
"@vue-js-cron/core" "1.0.0"
2035-
vuetify "^2.4.6"
2036-
20372029
"@vue/babel-helper-vue-jsx-merge-props@^1.2.1":
20382030
version "1.2.1"
20392031
resolved "https://registry.yarnpkg.com/@vue/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-1.2.1.tgz#31624a7a505fb14da1d58023725a4c5f270e6a81"

0 commit comments

Comments
 (0)