本指南将概述可用于创建文档的不同设计元素。
VuePress 提供了一个自定义容器插件来创建警稿框。有四种类型:
Markdown 范例
::: info
You can find more information at this site.
:::
::: tip
This is a great tip to remember!
:::
::: warning
This is something to be cautious of.
:::
::: danger DANGER
This is something we do not recommend. Use at your own risk.
:::
渲染 Markdown
INFO
You can find more information at this site。
TIP
This is a great tip to remember!
WARNING
This is something to be cautious of。
DANGER
This is something we do not recommend。Use at your own risk。
VuePress 使用 Prism 提供语言语法高亮显示,方法是将语言附加到代码块的起始反撇号:
Markdown 示例
```js
export default {
name: 'MyComponent'
}
```
渲染输出
export default {
name: 'MyComponent'
}
向代码块添加行高亮显示,需要在大括号中附加行号。
Markdown 示例
```js{2}
export default {
name: 'MyComponent',
props: {
type: String,
item: Object
}
}
```
渲染 Markdown
export default {
name: 'MyComponent',
props: {
type: String,
item: Object
}
}
```js{4-5}
export default {
name: 'MyComponent',
props: {
type: String,
item: Object
}
}
```
export default {
name: 'MyComponent',
props: {
type: String,
item: Object
}
}
```js{2,4-5}
export default {
name: 'MyComponent',
props: {
type: String,
item: Object
}
}
```
export default {
name: 'MyComponent',
props: {
type: String,
item: Object
}
}
(c) 2024 chaojicainiao.com MIT license