zoukankan      html  css  js  c++  java
  • Vue中:error 'XXXXX' is not defined no-undef解决办法

    Vue中:error 'XXXXX' is not defined no-undef解决办法

    报错内容:

    × Client
      Compiled with some errors in 7.42s
    √ Server
      Compiled successfully in 6.05s
     ERROR  Failed to compile with 1 errors                                                                               friendly-errors 17:33:15  
     ERROR  in ./pages/player/_vid.vue                                                                                friendly-errors 17:33:15  
    Module Error (from ./node_modules/eslint-loader/index.js):                                                                                friendly-errors 17:33:15  
    E:javaJavaWorkSpaceOnlineEducationWebReviewvue-front-1010pagesplayer\_vid.vue
      28:9  error  'Aliplayer' is not defined  no-undef
    ✖ 1 problem (1 error, 0 warnings)
    

    报错截图:

    解决办法:

    在使用vue的时候,使用一个全局变量,ESLint的语法会出现ESLint: 'Aliplayer' is not defined. (no-undef),说变量未定义,这时我们可以添加配置,取消这个校验。在.eslintrc.js文件中添加一个配置,位置如下图所示,我的全局变量就是Aliplayer。

    在eslintrc.js中的module.exports内添加如下代码块:

      "globals":{
        "Aliplayer": true
      }
    

    位置如下:

    module.exports = {
      root: true,
      parserOptions: {
      xxxxxx
      },
      env: {
      xxxxxx
      },
      rules: {
      xxxxxx
      },
      "globals":{
        "Aliplayer": true
      }
    }
    

  • 相关阅读:
    梅森素数
    高精度乘法
    快速幂取模
    高精度加法
    Linux 压缩&解压缩
    Lec_Cloud资源云平台
    IP102,IP102-K_V3.0 输入节点机
    A7互动主机
    音频处理器的使用
    关于测试随笔
  • 原文地址:https://www.cnblogs.com/Courage129/p/14037536.html
Copyright © 2011-2022 走看看