NODE.JS与VUE.JS的坑@[email protected]

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/chenzhuyu/article/details/81706262

格式化代码:ESLint: Expected indentation of 2 spaces but found 4. (indent)

~~ 在使用IDEA格式化代码的时候,会在js前面添加空格,导致编译出错 ~~

添加ESLint插件
在 .eslintrc.js 上右键,菜单底部有一个 "Apply ESLint Code Style Rule" 点它,之后自动格式化就会按照 eslint 的规则了
如果文件遇到语法问题 也可以右键选择修复了
https://segmentfault.com/q/1010000013824902/
File > Settings > Editor > Code Style > HTML > Other , 
“Do not indent children of” 添加 “script”

https://dragoshmocrii.com/fixing-eslint-expected-indentation-of-2-spaces-but-found-6-indent-in-phpstorm/
Preferences | Languages & Frameworks | JavaScript | Code Quality Tools | ESLint , 
启用Enable
Preferences | Languages & Frameworks | Node.js and NPM
勾选coding… 

Debug断点调试

Debug断点调试:方法一

这种方法不需要安装chrome插件,IDEA直接启动自定义命令的chrome,打开新页面完成调试

缺点:新开的chrome不加载其他插件,如VUE调试插件,每次调试都会打开一个chrome新窗口
http://www.cloudchou.com/web/post-993.html
/**可不用设置
打开config/index.js文件, 修改source map属性,从cheap-module-eval-source-map改为source-map
**/
新建JavaScript调试配置,并设置要访问的url,以及Remote url配置:
在URL处填写: http://localhost:8080
/**可不用设置
在src的Remote url处填写: webpack:///src
**/
保存好 调试配置
运行npm run start启动server
点击debug,JavaScript调试,这时候会打开chrome,WebStorm就会响应断点状态

Debug断点调试:方法二

这种方法需要安装chrome插件,chrome打开页面,IDEA监听完成调试
缺点:其他时候浏览chrome也会占用较高资源
Preferences | Build, Execution, Deployment | Debugger | Live Edit
勾选update app in chrome 并安装chrome插件

import from支持@/components这样的路径.

http://www.codes51.com/itwd/4537012.html

其实就是设置一下Webpack的配置文件路径
File > Settings > Languages and Frameworks >JavaScript > Webpack 
将路径指向到
/build/webpack.base.conf.js

猜你喜欢

转载自blog.csdn.net/chenzhuyu/article/details/81706262