zoukankan      html  css  js  c++  java
  • vue.js---利用vue cli脚手架工具+webpack创建项目遇到的坑

    1.Eslint js代码规范报错

     WARNING  Compiled with 2 warnings                                      10:43:26
    
    
      ✘  http://eslint.org/docs/rules/quotes                       Strings must use singlequote               
      src/components/HelloWorld.vue:43:9
        name: "HelloWorld",
               ^
    
      ✘  http://eslint.org/docs/rules/space-before-function-paren  Missing space before function parentheses  
      src/components/HelloWorld.vue:44:7
        data() {
             ^
    
      ✘  http://eslint.org/docs/rules/quotes                       Strings must use singlequote               
      src/components/HelloWorld.vue:46:12
            msg: "Welcome to Your Vue.js App"
                  ^
    
      ✘  http://eslint.org/docs/rules/semi                         Extra semicolon                            
      src/components/HelloWorld.vue:47:6
          };
            ^
    
      ✘  http://eslint.org/docs/rules/semi                         Extra semicolon                            
      src/components/HelloWorld.vue:49:2
      };
        ^
    
    
    ✘ 5 problems (5 errors, 0 warnings)
    
    
    Errors:
      2  http://eslint.org/docs/rules/quotes
      2  http://eslint.org/docs/rules/semi
      1  http://eslint.org/docs/rules/space-before-function-paren
    
    
      ✘  http://eslint.org/docs/rules/quotes  Strings must use singlequote  
      src/App.vue:43:9
        name: "App"
               ^
    
      ✘  http://eslint.org/docs/rules/semi    Extra semicolon               
      src/App.vue:44:2
      };
        ^
    
    
    ✘ 2 problems (2 errors, 0 warnings)
    
    
    Errors:
      1  http://eslint.org/docs/rules/quotes
      1  http://eslint.org/docs/rules/semi
    
    You may use special comments to disable some warnings.
    Use // eslint-disable-next-line to ignore the next line.
    Use /* eslint-disable */ to ignore all warnings in a file.
    

    出现这种问题是由于在bulid/webpack.base.conf.js里面有如下的配置:

    rules: [
    ...
    (config.dev.useEslint ? [createLintingRule()] : []),
    

    解决这个问题也很简单,点进config.dev.useEslint,发现在config/index.js里配置
    useEslint: true, // 改为false即可。

    2.引入element ui框架出现的问题



    出现这种错误的原因是没有把element ui下载到该项目路径下,所以在用npm或者淘宝镜像cnpm下载时,终端必须在该项目路径下打开,然后就可以顺利解决这个错误了

  • 相关阅读:
    CATransition
    OC中只有重写没有重载
    OC内存管理
    NSNotification
    关于一个小应用软件的思考
    tableView主从表在storyboard连线是 Selcetion Segue和Accessory Action的区别
    关于ios8模拟器不能输入中文问题以及软键盘不弹出问题
    UINavigation Bar中使用UIcollectionView,在UIcollectionView的顶端和低端出现空白的问题
    升级到Xcode6.2后 免证书真机调试出错的问题
    让UITableView 的 headerView跟随 cell一起滚动,tableHeaderView
  • 原文地址:https://www.cnblogs.com/ktddcn/p/10429635.html
Copyright © 2011-2022 走看看