Appearance
vitepress容器配置
颜色块
INFO
This is an info box.
TIP
This is a tip.
WARNING
This is a warning.
DANGER
This is a dangerous warning.
Details
This is a details block.
::: info
This is an info box.
:::
::: tip
This is a tip.
:::
::: warning
This is a warning.
:::
::: danger
This is a dangerous warning.
:::
::: details
This is a details block.
:::
::: info
This is an info box.
:::
::: tip
This is a tip.
:::
::: warning
This is a warning.
:::
::: danger
This is a dangerous warning.
:::
::: details
This is a details block.
:::
某一行高亮
js
export default {
data () {
return {
msg: 'Highlighted!'
}
}
}
export default {
data () {
return {
msg: 'Highlighted!'
}
}
}
高亮一行,其他的模糊
js
export default {
data () {
return {
msg: 'Focused!'
}
}
}
export default {
data () {
return {
msg: 'Focused!'
}
}
}
js
export default {
data () {
return {
msg: 'Focused!' // [!code这里一个空格focus]
}
}
}
export default {
data () {
return {
msg: 'Focused!' // [!code这里一个空格focus]
}
}
}
色彩差异
js
export default {
data () {
return {
msg: 'Removed'
msg: 'Added'
}
}
}
export default {
data () {
return {
msg: 'Removed'
msg: 'Added'
}
}
}
js
export default {
data () {
return {
msg: 'Removed' // [!code这里一个空格--]
msg: 'Added' // [!code这里一个空格++]
}
}
}
export default {
data () {
return {
msg: 'Removed' // [!code这里一个空格--]
msg: 'Added' // [!code这里一个空格++]
}
}
}
错误和警告
js
export default {
data () {
return {
msg: 'Error',
msg: 'Warning'
}
}
}
export default {
data () {
return {
msg: 'Error',
msg: 'Warning'
}
}
}
js
export default {
data () {
return {
msg: 'Error', // [!code这里一个空格error]
msg: 'Warning' // [!code这里一个空格warning]
}
}
}
export default {
data () {
return {
msg: 'Error', // [!code这里一个空格error]
msg: 'Warning' // [!code这里一个空格warning]
}
}
}
代码组
js
/**
* @type {import('vitepress').UserConfig}
*/
const config = {
// ...
}
export default config
/**
* @type {import('vitepress').UserConfig}
*/
const config = {
// ...
}
export default config
ts
import type { UserConfig } from 'vitepress'
const config: UserConfig = {
// ...
}
export default config
import type { UserConfig } from 'vitepress'
const config: UserConfig = {
// ...
}
export default config