You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/configuration.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -634,7 +634,7 @@ window.$docsify = {
634
634
635
635
- type: `Object`
636
636
637
-
Registers Vue components using the component name as the key with an object containing Vue options as the value. Component `data` is unique for each instance and will not persist as users navigate the site.
637
+
Creates and registers global [Vue components](https://vuejs.org/v2/guide/components.html). Components are specified using the component name as the key with an object containing Vue options as the value. Component `data` is unique for each instance and will not persist as users navigate the site.
638
638
639
639
```js
640
640
window.$docsify= {
@@ -667,7 +667,7 @@ window.$docsify = {
667
667
668
668
- type: `Object`
669
669
670
-
Specifies options for use with Vue content not explicitly mounted with [vueMounts](#mounting-dom-elements), [vueComponents](#components), or a [markdown script](#markdown-script). Changes to global `data` will persist and be reflected anywhere global references are used.
670
+
Specifies [Vue options](https://vuejs.org/v2/api/#Options-Data) for use with Vue content not explicitly mounted with [vueMounts](#mounting-dom-elements), [vueComponents](#components), or a [markdown script](#markdown-script). Changes to global `data` will persist and be reflected anywhere global references are used.
671
671
672
672
```js
673
673
window.$docsify= {
@@ -701,7 +701,7 @@ window.$docsify = {
701
701
702
702
- type: `Object`
703
703
704
-
Specifies DOM elements to mount as Vue instances and their associated options. Mount elements are specified using a [CSS selector](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) as the key with an object containing Vue options as their value. Docsify will mount the first matching element in the main content area each time a new page is loaded. Mount element `data` is unique for each instance and will not persist as users navigate the site.
704
+
Specifies DOM elements to mount as [Vue instances](https://vuejs.org/v2/guide/instance.html) and their associated options. Mount elements are specified using a [CSS selector](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) as the key with an object containing Vue options as their value. Docsify will mount the first matching element in the main content area each time a new page is loaded. Mount element `data` is unique for each instance and will not persist as users navigate the site.
Copy file name to clipboardExpand all lines: docs/vue.md
+18-9Lines changed: 18 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -193,7 +193,7 @@ Good {{ timeOfDay }}!
193
193
194
194
## Global options
195
195
196
-
Use `vueGlobalOptions` to specify options for use with Vue content not explicitly mounted with [vueMounts](#mounts), [vueComponents](#components), or a [markdown script](#markdown-script). Changes to global `data` will persist and be reflected anywhere global references are used.
196
+
Use `vueGlobalOptions` to specify [Vue options](https://vuejs.org/v2/api/#Options-Data) for use with Vue content not explicitly mounted with [vueMounts](#mounts), [vueComponents](#components), or a [markdown script](#markdown-script). Changes to global `data` will persist and be reflected anywhere global references are used.
197
197
198
198
```js
199
199
window.$docsify= {
@@ -237,7 +237,7 @@ Changes made to one counter affect the both counters. This is because both insta
237
237
238
238
## Mounts
239
239
240
-
Use `vueMounts` to specify DOM elements to mount as Vue instances and their associated options. Mount elements are specified using a [CSS selector](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) as the key with an object containing Vue options as their value. Docsify will mount the first matching element in the main content area each time a new page is loaded. Mount element `data` is unique for each instance and will not persist as users navigate the site.
240
+
Use `vueMounts` to specify DOM elements to mount as [Vue instances](https://vuejs.org/v2/guide/instance.html) and their associated options. Mount elements are specified using a [CSS selector](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) as the key with an object containing Vue options as their value. Docsify will mount the first matching element in the main content area each time a new page is loaded. Mount element `data` is unique for each instance and will not persist as users navigate the site.
241
241
242
242
```js
243
243
window.$docsify= {
@@ -269,7 +269,7 @@ window.$docsify = {
269
269
270
270
## Components
271
271
272
-
Use `vueComponents` to register Vue components using the component name as the key with an object containing Vue options as the value. Component `data` is unique for each instance and will not persist as users navigate the site.
272
+
Use `vueComponents` to create and register global [Vue components](https://vuejs.org/v2/guide/components.html). Components are specified using the component name as the key with an object containing Vue options as the value. Component `data` is unique for each instance and will not persist as users navigate the site.
273
273
274
274
```js
275
275
window.$docsify= {
@@ -327,11 +327,20 @@ Vue content can mounted using a `<script>` tag in your markdown pages.
327
327
328
328
## Technical Notes
329
329
330
-
- Docsify processes Vue content in the following order:
330
+
- Docsify processes Vue content in the following order on each page load:
331
331
1. Execute markdown `<script>`
332
-
1. Register `vueComponents`
333
-
1. Mount DOM elements via `vueMounts`
334
-
1. Process unmounted Vue content using `vueGlobalOptions`
332
+
1. Register global `vueComponents`
333
+
1. Mount `vueMounts`
334
+
1. Auto-mount unmounted `vueComponents`
335
+
1. Auto-mount unmounted Vue template syntax using `vueGlobalOptions`
336
+
- When auto-mounting Vue content, docsify will mount each top-level element in your markdown that contains template syntax or a component. For example, in the following HTML the top-level `<p>`, `<my-component />`, and `<div>` elements will be mounted.
337
+
```html
338
+
<p>{{ foo }}</p>
339
+
<my-component />
340
+
<div>
341
+
<span>{{ bar }}</span>
342
+
<some-other-component />
343
+
</div>
344
+
```
335
345
- Docsify will not mount an existing Vue instance or an element that contains an existing Vue instance.
336
-
- Docsify will automatically destroy/unmount all Vue instances it creates before new page content is loaded.
337
-
- When processing `vueGlobalOptions`, docsify parses the child elements within the main content area (`#main`) and mounts the element if it contains Vue content. Docsify does not parse each individual node within the main content area.
346
+
- Docsify will automatically destroy/unmount all Vue instances it creates before each page load.
0 commit comments