Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7cf1e7c

Browse files
committed
Update Vue-related descriptions and links
1 parent 43a73bb commit 7cf1e7c

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

docs/configuration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ window.$docsify = {
634634

635635
- type: `Object`
636636

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.
638638

639639
```js
640640
window.$docsify = {
@@ -667,7 +667,7 @@ window.$docsify = {
667667

668668
- type: `Object`
669669

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.
671671

672672
```js
673673
window.$docsify = {
@@ -701,7 +701,7 @@ window.$docsify = {
701701

702702
- type: `Object`
703703

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.
705705

706706
```js
707707
window.$docsify = {

docs/vue.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ Good {{ timeOfDay }}!
193193

194194
## Global options
195195

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.
197197

198198
```js
199199
window.$docsify = {
@@ -237,7 +237,7 @@ Changes made to one counter affect the both counters. This is because both insta
237237

238238
## Mounts
239239

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.
241241

242242
```js
243243
window.$docsify = {
@@ -269,7 +269,7 @@ window.$docsify = {
269269

270270
## Components
271271

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.
273273

274274
```js
275275
window.$docsify = {
@@ -327,11 +327,20 @@ Vue content can mounted using a `<script>` tag in your markdown pages.
327327

328328
## Technical Notes
329329

330-
- Docsify processes Vue content in the following order:
330+
- Docsify processes Vue content in the following order on each page load:
331331
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+
```
335345
- 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

Comments
 (0)