个人博客
日常记录

vuepress 定义变量 markdown 引用显示

编辑 docs\.vuepress\config.js

theme: defaultTheme({
  mail: '[email protected]',
  img: 'https://img.com/',
  html: '<a href="https://cn.bing.com/" taeget="_blank">必应一下</a>'
})

markdown 文档引用输出

<!--直接输出-->
邮箱:{{$theme.mail}}

<!--url引用-->
<img :src="$theme.img + 'images/images/vuepress.png'" alt="vuepress">

<!-- v-html 输出运行html代码-->
<p v-html="$theme.html"></p>

输出效果

邮箱:[email protected]

<img src="https://img.com/images/vuepress.png" alt="vuepress">

必应一下
赞(0)
未经允许不得转载:明日之子 » vuepress 定义变量 markdown 引用显示
分享短链