Skip to content

Commit b8753fc

Browse files
committed
docs: fix window is not defined
1 parent 6cea769 commit b8753fc

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

demo/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const flavor = process.env.VITE_FLAVOR
77

88
// https://vitejs.dev/config/
99
export default defineConfig({
10-
base: `demo/${flavor}`,
10+
base: `vue-js-cron/demo/${flavor}`,
1111
plugins: [vue()],
1212
resolve: {
1313
alias: {

docs/src/.vuepress/client.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,13 @@ function prefersDark() {
3030

3131
export default defineClientConfig({
3232
enhance ({ app, router, siteData }) {
33+
let dark = true;
34+
if (!__VUEPRESS_SSR__) {
35+
dark = prefersDark()
36+
}
37+
3338
const myTheme = {
34-
dark: prefersDark(),
39+
dark: dark,
3540
colors: {
3641
secondary: '#3AA675',
3742
},

docs/src/.vuepress/components/custom-fields.vue

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@
1313

1414
<script>
1515
16-
import core from '@vue-js-cron/core'
17-
const { locale, util } = core
16+
import { defaultItems, genItems, pad } from '@vue-js-cron/core'
1817
1918
export default {
2019
data () {
21-
const defaultItems = locale.defaultItems('en')
20+
const items = defaultItems('en')
2221
2322
return {
2423
value: '* * * * *',
@@ -30,11 +29,11 @@ export default {
3029
{ id: 'second', value: [] }
3130
],
3231
fields: [
33-
{ id: 'second', items: util.genItems(0, 59, (value) => util.pad(value, 2)) },
34-
{ id: 'minute', items: defaultItems.minuteItems },
35-
{ id: 'hour', items: defaultItems.hourItems },
36-
{ id: 'day', items: defaultItems.dayItems },
37-
{ id: 'month', items: defaultItems.monthItems }
32+
{ id: 'second', items: genItems(0, 59, (value) => pad(value, 2)) },
33+
{ id: 'minute', items: items.minuteItems },
34+
{ id: 'hour', items: items.hourItems },
35+
{ id: 'day', items: items.dayItems },
36+
{ id: 'month', items: items.monthItems }
3837
],
3938
cols (fieldId) {
4039
if (fieldId === 'minute') return 5

0 commit comments

Comments
 (0)