diff --git a/docs/configuration.md b/docs/configuration.md
index 7a65553a..54d6720f 100644
--- a/docs/configuration.md
+++ b/docs/configuration.md
@@ -494,15 +494,15 @@ window.$docsify = {
```
## crossOriginLinks
-- type: `Array`
-When `routerMode: 'history'`, you may face the cross-origin issues, See [#1379](https://github.com/docsifyjs/docsify/issues/1379).
-In Markdown content, there is a simple way to solve it, see extends Markdown syntax `Cross-Origin link` in [helpers](helpers.md).
+- type: `Array`
+
+When `routerMode: 'history'`, you may face the cross-origin issues, See [#1379](https://github.com/docsifyjs/docsify/issues/1379).
+In Markdown content, there is a simple way to solve it, see extends Markdown syntax `Cross-Origin link` in [helpers](helpers.md).
+
```js
window.$docsify = {
- crossOriginLinks:[
- "https://example.com/cross-origin-link",
- ],
+ crossOriginLinks: ['https://example.com/cross-origin-link'],
};
```
@@ -629,3 +629,104 @@ window.$docsify = {
topMargin: 90, // default: 0
};
```
+
+## vueComponents
+
+- type: `Object`
+
+Registers Vue components using the component name as the key with an object containing Vue options as the value.
+
+```js
+window.$docsify = {
+ vueComponents: {
+ 'button-counter': {
+ template: `
+
+ `,
+ data() {
+ return {
+ count: 0,
+ };
+ },
+ },
+ },
+};
+```
+
+```markdown
+
2 + 2 = {{ 2 + 2 }}
- - +Text for GitHub
- +2 + 2 = {{ 2 + 2 }}
``` -[View markdown on GitHub](https://github.com/docsifyjs/docsify/blob/develop/docs/vue.md#template-syntax) +[View output on GitHub](https://github.com/docsifyjs/docsify/blob/develop/docs/vue.md#template-syntax) -Vue content becomes more interesting when data, methods, lifecycle hooks, and computed properties are used. These options can be specified as [global options](#global-options), [instance options](#instance-options), or within [components](#components). +Vue content becomes more interesting when [data](#data), [computed properties](#computed-properties), [methods](#methods), and [lifecycle hooks](#lifecycle-hooks) are used. These options can be specified as [global options](#global-options), [instance options](#instance-options), or within [components](#components). + +### Data ```js { data() { return { - message: 'Hello, World!', + message: 'Hello, World!' + }; + } +} +``` + + +```markdown + +{{ message }} + + + + + +Text for GitHub
+``` + + + + +[View output on GitHub](https://github.com/docsifyjs/docsify/blob/develop/docs/vue.md#data) + +### Computed properties + +```js +{ + computed: { + timeOfDay() { + const date = new Date(); + const hours = date.getHours(); + + if (hours < 12) { + return 'morning'; + } + else if (hours < 18) { + return 'afternoon'; + } + else { + return 'evening' + } + } + }, +} +``` + +```markdown +Good {{ timeOfDay }}! +``` + + + +### Methods + +```js +{ + data() { + return { + message: 'Hello, World!' }; }, methods: { hello() { alert(this.message); } - } + }, } ``` -```markdown - - - - -Text for GitHub
- - -- -
-``` - -[View markdown on GitHub](https://github.com/docsifyjs/docsify/blob/develop/docs/vue.md#options) +### Lifecycle Hooks + +```js +{ + data() { + return { + images: null, + }; + }, + created() { + fetch('https://api.domain.com/') + .then(response => response.json()) + .then(data => (this.images = data)) + .catch(err => console.log(err)); + } +} + +// API response: +// [ +// { title: 'Image 1', url: 'https://domain.com/1.jpg' }, +// { title: 'Image 2', url: 'https://domain.com/2.jpg' }, +// { title: 'Image 3', url: 'https://domain.com/3.jpg' }, +// ]; +``` + +```markdown +