less报错
2021-02-03 本文已影响0人
小蜗牛的碎碎步
问题描述
vue-cli构建的项目,安装less,less-loader后,在组件中使用lang='less'报错。
Xnip2021-02-03_14-54-22.jpg
package.json
"dependencies": {
"axios": "^0.21.1",
"core-js": "^3.6.5",
"less": "^4.1.1",
"less-loader": "^8.0.0",
"vue": "^2.6.11",
"vue-router": "^3.5.1",
"vuex": "^3.6.2"
},
组件.vue
<style scoped lang="less">
.no-found {
padding-top: 120px;
}
</style>
解决方案
将less-loader从8.0.0降到7.3.0
"dependencies": {
"axios": "^0.21.1",
"core-js": "^3.6.5",
"less": "^4.1.1",
"less-loader": "^7.3.0",
"vue": "^2.6.11",
"vue-router": "^3.5.1",
"vuex": "^3.6.2"
},