Unexpected character '@'
antd-design-vue按需引入报错如下:Unexpected character ‘@’解决方法:将.babelrc 里面的style 改为 false"plugins": [["import",{ "libraryName": "ant-design-vue", "libraryDirectory": "...
·
antd-design-vue按需引入报错如下:
Unexpected character ‘@’
解决方法:
- 将.babelrc 里面的style 改为 false
"plugins": [
[
"import",
{ "libraryName": "ant-design-vue", "libraryDirectory": "es", "style": false }
]
]
- 将样式在main.js中全局引入
import 'ant-design-vue/dist/antd.css'
- 在组件中这样使用
<a-button></a-button>
import { Button } from 'ant-design-vue'
export default {
components:{
AButton:Button
}
}
更多推荐
已为社区贡献4条内容
所有评论(0)