1.安装插件Debugger for Chrome
2.安装Chrome浏览器

添加配置launch.json,复制以下代码
{
"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}/*"
}
}
]
}
3.在vue.config.js中添加一句 devtool: 'source-map'

网友评论