mirror of
https://github.com/zhigang1992/docsify.git
synced 2026-04-28 09:26:26 +08:00
1.9 (#62)
* Destroys the vue instance when the route is changed * Add new doc helper * Update docs
This commit is contained in:
@@ -160,10 +160,10 @@ window.$docsify = {
|
||||
### Doc Helpers
|
||||
#### p.tip
|
||||
|
||||
'! ' add your content will rendered as `<p class="tip">content</p>`
|
||||
`!> ` add your content will rendered as `<p class="tip">content</p>`
|
||||
|
||||
```markdown
|
||||
! Important **information**
|
||||
!> Important **information**
|
||||
```
|
||||
|
||||
It will be rendered
|
||||
@@ -174,9 +174,48 @@ It will be rendered
|
||||
|
||||
e.g.
|
||||
|
||||
! Important **information**
|
||||
!> Important **information**
|
||||
|
||||
|
||||
#### p.warn
|
||||
|
||||
```markdown
|
||||
?> todo info
|
||||
```
|
||||
|
||||
?> todo info
|
||||
|
||||
### Combining Vue
|
||||
We can write the Vue syntax directly in the markdown file, when the Vue library is loaded into `index.html`. Default will automatically initialize a Vue instance, of course, we can also manually.
|
||||
|
||||
index.html
|
||||
```html
|
||||
<script src="//unpkg.com/vue"></script>
|
||||
<script src="//unpkg.com/docsify" data-router></script>
|
||||
```
|
||||
|
||||
```markdown
|
||||
<ul>
|
||||
<li v-for="i in 10">{{ i }}</li>
|
||||
</ul>
|
||||
```
|
||||
|
||||
Manual initialization
|
||||
|
||||
```markdown
|
||||
<div>
|
||||
<input type="text" v-model="msg">
|
||||
<p>Hello, {{ msg }}</p>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: 'main',
|
||||
data: { msg: 'Docsify' }
|
||||
})
|
||||
</script>
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
You can add configurations in the script tag attributes or with `window.$docsify`.
|
||||
|
||||
Reference in New Issue
Block a user