1.安装插件:‘babel-plugin-dynamic-import-node’
npm install babel-plugin-dynamic-import-node -D<br /> **修改配置文件:babel.config.js**<br />** **** **module.exports = { <br />env: { <br />development: { <br /> plugins: ['dynamic-import-node'] <br /> } <br /> }<br />}<br />![image.png](https://cdn.nlark.com/yuque/0/2021/png/705245/1616031142548-a3c31783-e324-4186-9845-3d750037ecd4.png#align=left&display=inline&height=337&margin=%5Bobject%20Object%5D&name=image.png&originHeight=337&originWidth=988&size=22083&status=done&style=none&width=988)
2.expected indentation of 0 spaces but found 2 . vue eslint规则和idea冲突
解决办法:<br />1、不校验缩进,在rule里增加如下规则:
'rules': {
'indent': 'off'
}
3.vue项目中关闭eslint
在项目根目录下增加vue.config.js文件。
内容如下:
// vue.config.js
module.exports = { lintOnSave: false }