我的项目架构
Vue3 + element-plus + echarts + axios + 高德地图 + sass
插件包
amfe-flexible + postcss-pxtorem、vuex-persistedstate、sass-loader
创立前提
1、把脚手架降级到最新
2、把 npm 降级到最新
留神:用管理员权限操作
报错 / 正告
error: 'XXX' is defined but never used (no-unused-vars)// 解决办法:package.json 中增加
"rules": {
"generator-star-spacing": "off",
"no-tabs":"off",
"no-unused-vars":"off",
"no-console":"off",
"no-irregular-whitespace":"off",
"no-debugger": "off"
}
Error: PostCSS plugin postcss-pxtorem requires PostCSS 8.”// 解决办法,降级为:"postcss-pxtorem": "^5.1.1",
Error: Cannot find module 'vue-loader-v16/package.json'
// 把 cnpm 装置换成 npm 装置
"export'default'(imported as'echarts') was not found in'echarts'// 改成 import * as echarts from"echarts";
sass-loader
// 版本改成 "sass-loader": "^7.1.1"