Skip to content

Commit aa66330

Browse files
committed
feat: use vuepress instead of docute
1 parent e59b49a commit aa66330

File tree

21 files changed

+6127
-284
lines changed

21 files changed

+6127
-284
lines changed

core/src/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
// Import vue component
2+
import util from './util'
23
import component from './core.vue';
34

45
// Declare install function executed by Vue.use()
56
export function install(Vue) {
67
if (install.installed) return;
78
install.installed = true;
8-
Vue.component('VueCron', component);
9+
Vue.component('CronCore', component);
910
}
1011

1112
// Create module definition for Vue.use()
1213
const plugin = {
1314
install,
15+
component,
16+
util
1417
};
1518

1619
// Auto-install when vue is found (eg. in browser via <script> tag)
@@ -25,4 +28,4 @@ if (GlobalVue) {
2528
}*/
2629

2730
// To allow use as module (npm/webpack/etc.) export component
28-
export default component;
31+
export default plugin;

docs/.gitignore

100644100755
Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1-
.vscode
1+
pids
2+
logs
23
node_modules
3-
dist
4+
npm-debug.log
5+
coverage/
6+
run
7+
dist
8+
.DS_Store
9+
.nyc_output
10+
.basement
11+
config.local.js
12+
basement_dist
13+
.cache
14+
.temp

docs/README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/index.html

Lines changed: 0 additions & 18 deletions
This file was deleted.

docs/package.json

100644100755
Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
{
22
"name": "@vue-js-cron/docs",
3-
"version": "1.0.0",
4-
"description": "Documentation for renderless Vue.js cron editor.",
3+
"version": "0.0.1",
4+
"description": "vue-js-cron documentation",
5+
"main": "index.js",
6+
"authors": {
7+
"name": "Andreas Bichinger",
8+
"email": "andreas.bichinger@gmail.com"
9+
},
10+
"repository": "https://github.com/abichinger/vue-js-cron/@vue-js-cron/docs",
511
"scripts": {
6-
"start": "yarn run serve ."
12+
"dev": "vuepress dev src",
13+
"build": "vuepress build src"
714
},
8-
"author": "Andreas Bichinger",
915
"license": "MIT",
1016
"devDependencies": {
11-
"serve": "^13.0.2"
17+
"vuepress": "^1.8.2"
1218
},
1319
"dependencies": {
14-
"@vue-js-cron/core": "^1.0.0",
15-
"@vue-js-cron/vuetify": "^1.0.0"
20+
"@vue-js-cron/core": "1.0.0",
21+
"@vue-js-cron/vuetify": "1.0.0",
22+
"buefy": "^0.9.13"
1623
}
1724
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<template>
2+
<selection-grid v-model="value" :items="items">
3+
</selection-grid>
4+
</template>
5+
6+
<script>
7+
import core from '@vue-js-cron/core'
8+
const {util} = core
9+
10+
export default {
11+
data() {
12+
let a = new Array(60).fill(0)
13+
return {
14+
value: undefined,
15+
items: a.map((_, i) => {return {value: i, text: util.pad(i, 2)}})
16+
}
17+
},
18+
}
19+
</script>
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<template>
2+
<div class="is-flex is-flex-wrap-wrap">
3+
<div v-for="item in items" class="flex-shrink has-text-centered p-2" :class="{...columnClasses, 'selected-value': isSelected(item)}" :key="item[valueKey]" @click="select(item)">{{item[textKey]}}</div>
4+
<div class="column flex-grow"></div>
5+
</div>
6+
</template>
7+
8+
<script>
9+
export default {
10+
props: {
11+
multiple: {
12+
type: Boolean,
13+
default: false
14+
},
15+
value: {
16+
default: function(){
17+
return (this.multiple) ? [] : undefined
18+
}
19+
},
20+
items:{
21+
type: Array,
22+
default: () => []
23+
},
24+
textKey:{
25+
type: String,
26+
default: 'text'
27+
},
28+
valueKey:{
29+
type: String,
30+
default: 'value'
31+
},
32+
columnClasses: {
33+
type: Object,
34+
default: () => {}
35+
},
36+
},
37+
data() {
38+
return {}
39+
},
40+
methods:{
41+
select(item){
42+
console.log('select', item)
43+
if(this.multiple){
44+
let value = this.value.slice()
45+
value.append(item.value)
46+
this.$emit('input', value)
47+
}
48+
else{
49+
this.$emit('input', item.value)
50+
}
51+
},
52+
isSelected(item){
53+
if(this.multiple){
54+
return this.value.includes(item.value)
55+
}
56+
else{
57+
return this.value === item.value
58+
}
59+
}
60+
}
61+
}
62+
</script>
63+
64+
<style scoped>
65+
66+
.selected-value {
67+
background-color: blue;
68+
}
69+
70+
</style>

docs/src/.vuepress/config.js

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
const { description } = require('../../package')
2+
3+
module.exports = {
4+
/**
5+
* Ref:https://v1.vuepress.vuejs.org/config/#title
6+
*/
7+
title: 'Vue-js-cron Docs',
8+
/**
9+
* Ref:https://v1.vuepress.vuejs.org/config/#description
10+
*/
11+
description: description,
12+
13+
/**
14+
* Extra tags to be injected to the page HTML `<head>`
15+
*
16+
* ref:https://v1.vuepress.vuejs.org/config/#head
17+
*/
18+
head: [
19+
['meta', { name: 'theme-color', content: '#3eaf7c' }],
20+
['meta', { name: 'apple-mobile-web-app-capable', content: 'yes' }],
21+
['meta', { name: 'apple-mobile-web-app-status-bar-style', content: 'black' }]
22+
],
23+
24+
/**
25+
* Theme configuration, here is the default theme configuration for VuePress.
26+
*
27+
* ref:https://v1.vuepress.vuejs.org/theme/default-theme-config.html
28+
*/
29+
themeConfig: {
30+
repo: '',
31+
editLinks: false,
32+
docsDir: '',
33+
editLinkText: '',
34+
lastUpdated: false,
35+
nav: [
36+
{
37+
text: 'Guide',
38+
link: '/guide/',
39+
},
40+
{
41+
text: 'Config',
42+
link: '/config/'
43+
},
44+
{
45+
text: 'VuePress',
46+
link: 'https://v1.vuepress.vuejs.org'
47+
}
48+
],
49+
sidebar: {
50+
'/guide/': [
51+
{
52+
title: 'Guide',
53+
collapsable: false,
54+
children: [
55+
'',
56+
'getting-started',
57+
]
58+
}
59+
],
60+
}
61+
},
62+
63+
/**
64+
* Apply plugins,ref:https://v1.vuepress.vuejs.org/zh/plugin/
65+
*/
66+
plugins: [
67+
'@vuepress/plugin-back-to-top',
68+
'@vuepress/plugin-medium-zoom',
69+
]
70+
}

docs/src/.vuepress/enhanceApp.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import Buefy from 'buefy'
2+
import 'buefy/dist/buefy.css'
3+
import CronCore from '@vue-js-cron/core'
4+
import CronVuetify from '@vue-js-cron/vuetify'
5+
import Vuetify from "vuetify";
6+
import "vuetify/dist/vuetify.min.css";
7+
import "@vue-js-cron/vuetify/dist/dist/vuetify.min.css"
8+
9+
export default ({
10+
Vue, // the version of Vue being used in the VuePress app
11+
options, // the options for the root Vue instance
12+
router, // the router instance for the app
13+
siteData // site metadata
14+
}) => {
15+
Vue.use(Vuetify);
16+
options.vuetify = new Vuetify({})
17+
Vue.use(Buefy)
18+
Vue.use(CronCore);
19+
Vue.use(CronVuetify);
20+
}

docs/src/.vuepress/styles/index.styl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* Custom Styles here.
3+
*
4+
* ref:https://v1.vuepress.vuejs.org/config/#index-styl
5+
*/
6+
7+
.home .hero img
8+
max-width 450px!important

0 commit comments

Comments
 (0)