美文网首页
less报错

less报错

作者: 小蜗牛的碎碎步 | 来源:发表于2021-02-03 15:13 被阅读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"
      },
    

    相关文章

      网友评论

          本文标题:less报错

          本文链接:https://www.haomeiwen.com/subject/xdtmtltx.html