Vue学习笔记Day-2
Vue使用vant插件样式不生效
步骤1:安装 babel-plugin-import
cnpm install babel-plugin-import --save
步骤2:在.babelrc文件中增加如下代码["import", {"libraryName": "vant","style": true}]
.babelrc文件全部代码如下:
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
}
}],
"stage-2"
],
"plugins": ["transform-vue-jsx", "transform-runtime", ["import", {
"libraryName": "vant",
"style": true
}]]
}