使用VS Code 调试Vue

编程入门 行业动态 更新时间:2024-10-23 09:22:57

使用VS <a href=https://www.elefans.com/category/jswz/34/1771384.html style=Code 调试Vue"/>

使用VS Code 调试Vue

  1. 在VS Code扩展中下载对应浏览器的插件:Debugger for Chrome(谷歌浏览器) ;Debugger for Firefor(火狐浏览器);没有浏览器的得先安装对应的浏览器.

  2.在 "调试" 菜单中选择"打开配置"  会打开 launch.js 文件 添加以下配置.

{// 使用 IntelliSense 了解相关属性。 // 悬停以查看现有属性的描述。// 欲了解更多信息,请访问: /?linkid=830387"version": "0.2.0","configurations": [{"type": "node","request": "launch","name": "启动程序","program": "${workspaceFolder}\\dev"},
        {"type": "firefox","request": "launch","name": "vuejs: firefox","url": "http://localhost:8080","webRoot": "${workspaceFolder}/src","pathMappings": [{ "url": "webpack:///src/", "path": "${webRoot}/" }]},{"type": "chrome","request": "launch","name": "vuejs: chrome","url": "http://localhost:8080","webRoot": "${workspaceFolder}/src","breakOnLoad": true,"sourceMapPathOverrides": {"webpack:///src/*": "${webRoot}/*"}}]
}

  3.运行Vue项目.(npm run dev)

  4.打开要调试的vue文件,选择要使用的浏览器. 点击开始调试 浏览器就会自动运行,输入网页地址就可以调试了.

 

转载于:.html

更多推荐

使用VS Code 调试Vue

本文发布于:2024-03-13 16:44:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1734404.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Code   Vue

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!