zoukankan      html  css  js  c++  java
  • vue项目给less传递参数,出现 Invalid options object. Less Loader has been initialized using an options object that does not match the API schema.

    vue-cli创建的项目,想使用less-loader的全局变量配置,但是配置(vue.config.js文件)项出现

    error in ./src/components/BookFooter.vue?vue&type=style&index=0&id=18045bd8&lang=less&scoped=true&

    Module build failed (from ./node_modules/less-loader/dist/cjs.js):
    ValidationError: Invalid options object. Less Loader has been initialized using an options object that does not match the API schema.
    - options has an unknown property 'globalVars'. These properties are valid:
    object { lessOptions?, prependData?, appendData?, sourceMap?, implementation? }

    错误,但是这句本身已给出可以配置less的配置项,我们要在 lessOptions 属性里配置less的配置项。如下:

     这样配置就可以了,less的变量引用直接使用 @变量名称  即可使用,例如:@BodyWidthVar。接下来就可以使用了

     
    复制请注明出处,在世界中挣扎的灰太狼
  • 相关阅读:
    2.2 整数表示
    2.1 信息存储
    c++ string.erase()函数的使用
    classmethod修饰符
    27. 序列化
    26. 操作文件目录
    Java 内部类
    ConcurrentHashMap 源码解析 -- Java 容器
    Storm中的LocalState 代码解析
    Java中 return 和finally
  • 原文地址:https://www.cnblogs.com/XingXiaoMeng/p/13201425.html
Copyright © 2011-2022 走看看