Skip to content

Commit 9274e93

Browse files
committed
doc: Add how to use plugin
1 parent 0daec72 commit 9274e93

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed

.versionrc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ module.exports = {
66
{ type: 'chore', section: 'Chores', hidden: false },
77
{ type: 'docs', section: 'Document Changes', hidden: false },
88
{ type: 'refactor', section: 'Refactoring', hidden: false },
9-
{ type: 'test', section: 'Test Improve', hidden: false }
10-
]
9+
{ type: 'test', section: 'Test Improve', hidden: false },
10+
],
1111
}

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ export default {
3535
dayjs: {
3636
locales: ['en', 'ja'],
3737
defaultLocale: 'en',
38-
plugins: [] // Your Day.js plugin
38+
plugins: [
39+
'utc' // import 'dayjs/plugin/utc'
40+
] // Your Day.js plugin
3941
}
4042
// ...
4143
}

test/fixture/nuxt.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ module.exports = {
77
dev: process.env.NODE_ENV !== 'test' && process.env.NODE_ENV === 'production',
88
dayjs: {
99
locales: ['ja'],
10-
plugins: ['advancedFormat', 'localizedFormat']
11-
}
10+
plugins: ['advancedFormat', 'localizedFormat'],
11+
},
1212
}

test/fixture/pages/plugin.vue

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,9 @@
88
export default {
99
asyncData(context) {
1010
return {
11-
advancedFormat: context
12-
.$dayjs('2018-08-16')
13-
.format('Do'),
14-
localized: context
15-
.$dayjs('2018-08-16')
16-
.format('ll')
11+
advancedFormat: context.$dayjs('2018-08-16').format('Do'),
12+
localized: context.$dayjs('2018-08-16').format('ll'),
1713
}
18-
}
14+
},
1915
}
20-
</script>
16+
</script>

0 commit comments

Comments
 (0)