wqy的笔记:http://www.upwqy.com/details/261.html
作者:wqy
1 首先在项目中安装prismjs插件:
cnpm install prismjs -S
2 安装完成后,需要继续安装一个prismjs的编译器插件
cnpm install babel-plugin-prismjs -D
3 在.babelrc文件中配置使用该插件:
{
"plugins": [
["prismjs", {
"languages": ["javascript", "css", "markup"],
"plugins": ["line-numbers"],
"theme": "twilight",
"css": true
}]
]
}
5 prismjs 官网地址:https://prismjs.com/