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里面有如下的配置:
module: { rules: [ ... (config.dev.useEslint ? [createLintingRule()] : []),
解决这个问题也很简单,点进config.dev.useEslint,发现在config/index.js里配置
useEslint: true, // 改为false即可。

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

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

转载于:https://www.cnblogs.com/ktddcn/p/10429635.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值