Closed islittlezhou closed 2 years ago
提供复现
提供复现
上面是我用 vue/cli 直接新建的一个 vue3 项目, 然后装了 surly zhege这个表格插件, 引入 index.less,然后就报错了。 我的 node 版本是 12.22.0 操作系统是 Win7_64旗舰版 16GB内存 64位操作系统
第一、安装 ant-design-vue 第二、less、less-loader 都升级最新版 第三、配置 vue.config.js 文件
module.exports = {
css: {
loaderOptions: {
less: {
lessOptions: {
// DO NOT REMOVE THIS LINE
javascriptEnabled: true,
},
},
},
},
};
less-loader 版本太高, 有时候跟 其它插件不兼容, 有时候还跟 nodejs 版本有关系, nodejs版本到 14 后就必须是 win10 操作系统了。。
less-loarder 升级到最高后 又 出现了其它问题, 不兼容,, 各种情况。。。
下面是 package.json { "name": "v3-demo1", "version": "0.1.0", "private": true, "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build" }, "eslintConfig": { "rules": { "no-undef": "off", "no-restricted-globals": "off", "no-unused-vars": "off" } }, "dependencies": { "@ant-design/icons-vue": "^6.0.1", "@surely-vue/table": "^2.2.1", "@wefly/vue-rescroll": "^1.0.1", "ant-design-vue": "^3.1.0", "axios": "^0.24.0", "core-js": "^3.6.5", "crypto-js": "^4.1.1", "element-resize-detector": "^1.2.4", "js-cookie": "^3.0.1", "jsencrypt": "^3.2.1", "lodash": "^4.17.21", "moment": "^2.29.1", "nanoid": "^3.1.30", "node-rsa": "^1.1.1", "nprogress": "^0.2.0", "uuid": "^8.3.2", "vue": "^3.2.31", "vue-happy-scroll": "^2.1.1", "vue-router": "^4.0.0-0", "vue3-perfect-scrollbar": "^1.5.5", "vuebar": "0.0.20", "vuescrollnext": "^1.0.3", "vuex": "^4.0.0-0" }, "devDependencies": { "@vue/cli-plugin-babel": "~4.5.0", "@vue/cli-plugin-router": "~4.5.0", "@vue/cli-plugin-vuex": "~4.5.0", "@vue/cli-service": "~4.5.0", "@vue/compiler-sfc": "^3.0.0", "babel-plugin-import": "^1.13.3", "less": "^4.1.2", "less-loader": "^6.0.0", "vue-loader-v16": "^16.0.0-beta.5.4" } }
下面是 babel.config.js module.exports = { presets: [ '@vue/cli-plugin-babel/preset' ] }