Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vscode 一些使用心得 #12

Open
leopen-hu opened this issue Jan 17, 2018 · 2 comments
Open

vscode 一些使用心得 #12

leopen-hu opened this issue Jan 17, 2018 · 2 comments

Comments

@leopen-hu
Copy link
Owner

No description provided.

@leopen-hu
Copy link
Owner Author

  • Q: 如何让在使用 vetur 时支持 space-before-function-paren
  • A: 需要安装 prettier-eslint, 然后如下设置
    "eslint.autoFixOnSave": true,
    "eslint.options": {
      "rules": {
        "space-before-function-paren": [
          "error",
          "always"
        ]
      }
    },
    

@leopen-hu
Copy link
Owner Author

leopen-hu commented Mar 21, 2018

Q:如何在vs code中断电调试vue代码?
A:见文章 《Visual Studio Code 断点调试 Vue》,关键点有:

  1. launch.json attach 配置,注意以下这段
"sourceMaps": true,
"sourceMapPathOverrides": {
    "webpack:///src/*": "${webRoot}/*"
}
"port": 9222,
  1. 启动chrome时需要加 --remote-debugging-port=9222 。需要注意,如果启动后本地9222端口未打开,请检查chrome是否退出后仍在后台运行。具体的配置方式如下:
    • 找到chrome快捷方式(C:\ProgramData\Microsoft\Windows\Start Menu\Programs\)
    • 右键属性执行如下更改
      image
    • 退出(保证后台已经退出)并重新启动chrome
      image
  2. webconfig的设置需要修改(文章中的版本可能不一致,直接搜索配置名devtool即可):
devtool: '#eval-source-map',

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant