Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the three debugging methods provided by Vue

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "what are the three debugging methods provided by Vue". The explanation in the article is simple and clear and easy to learn and understand. Please follow the editor's train of thought to study and learn "what are the three debugging methods provided by Vue?"

Configure debugging in VS Code

When building a project using Vue CLI 2:

Update the devtool property in config/index.js:

Devtool: 'source-map'

Click the Debugger icon in Activity Bar to come to the Debug view:

Select the Chrome/Firefox:Launch environment. Replace the contents of launch.json with:

{"version": "0.2.0", "configurations": [{"type": "chrome", "request": "launch", "name": "vuejs: chrome", "url": "http://localhost:8080"," webRoot ":" ${workspaceFolder} / src "," breakOnLoad ": true "sourceMapPathOverrides": {"webpack:///src/*": "${webRoot} / *"}, {"type": "firefox", "request": "launch", "name": "vuejs: firefox", "url": "http://localhost:8080"," webRoot ":" ${workspaceFolder} / src " "pathMappings": [{"url": "webpack:///src/", "path": "${webRoot} /"}]}

Start debugging:

Set the breakpoint:

# launch Project npm run dev

Select "vuejs:chrome" on the debug page:

II. Debugger statement

Recommend

Function potentiallyBuggyCode () {debugger / / do potentially buggy stuff to examine, step through, etc.}

Browser: F12 opens DevTools, and when running the program, it stops at the debbger statement:

Note: when the Eslint plug-in is installed, click Quick repair, Disable no-debugger for this line. Otherwise, the debugger statement is automatically cleared when it is saved.

III. Vue Devtools

Google browser plug-in.

Thank you for your reading, the above is the content of "what are the three debugging methods provided by Vue". After the study of this article, I believe you have a deeper understanding of what the three debugging methods provided by Vue are, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report