VSCode如何設置Vue前端的debug調試


 

 

vscode在調試vue.代碼時,如何進行debug?

1.安裝Chrome Debug插件。

clipboard

2.在launch.json中,將url修改成你前端項目的路徑:

clipboard

  1 {
  2   // Use IntelliSense to learn about possible attributes.
  3   // Hover to view descriptions of existing attributes.
  4   // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  5   "version": "0.2.0",
  6   "configurations": [
  7     {
  8       "type": "chrome",
  9       "request": "launch",
 10       "name": "Chrome 調試",
 11       "url": "http://localhost:8090/#/login",
 12       "webRoot": "${workspaceFolder}/src",
 13       "breakOnLoad": false,
 14       "sourceMapPathOverrides": {
 15         "webpack:///src/*": "${webRoot}/*"
 16       }
 17     }
 18   ]
 19 }

3.vue-cli2版本的,修改config/index.js中配置:

clipboard

完成以上配置,重啟項目,打上斷點即可。

clipboard

clipboard


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM