1.安装
yarn add github-markdown-css
2.导入
import 'github-markdown-css/github-markdown.css'
3.给要使用样式的文章添加类名markdown-body
<div class="article markdown-body" v-else-if="200">
4. .postcssrc.js文件中配置 exclude: 'github-markdown' 不转换github-markdown中字号样式
module.exports = {
plugins: {
'postcss-pxtorem': {
// rootValue: 37.5,
rootValue({ file }) {
return file.indexOf('vant') > -1 ? 37.5 : 75
},
propList: ['*'],
exclude: 'github-markdown' //配置不要转换的样式资源
}
}
}