Coder Social home page Coder Social logo

Comments (2)

chengpeiquan avatar chengpeiquan commented on June 4, 2024

新年好啊!不过我没看太懂问题里的意思,是指在浏览器里断点后没有关联到 VSCode 里的源码吗?

可以尝试在项目根目录下创建一个 .vscode 文件夹,添加一个 launch.json ,写入下面的配置:

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "chrome",
      "request": "launch",
      "name": "针对 localhost 启动 Chrome",
      "url": "http://localhost:3000",
      "webRoot": "${workspaceFolder}"
    }
  ]
}

启动本地服务后,点这里唤起调试,这样运行后在浏览器里打的断点就会和编辑器关联了,断点到了哪里,源码也会对应的高亮。

3

2

from learning-vue3.

yubeihai avatar yubeihai commented on June 4, 2024

我按照大佬的方法试了一下我从github上找的项目,还是不行,然后我自己建了一个脚手架试了一下可以加上断点,vscode上不加这个文件,不启动也可以断点到源代码。
1674991911
image
然后我加断点加在44行,断点会加在86行。执行的时候也是在86行断点。
image

可能还是有哪些配置没开启导致的这个问题。非常感谢大佬百忙之中的解答,嘿嘿。

from learning-vue3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.