Node.js/nuxt/debugger
来自康健生活
标题文字
nuxt.config.js
// 本代码段使用 TypeScript 写法,JavaScript 类似
extend(config, ctx) {
// Run ESLint on save
if (ctx.isDev && ctx.isClient) {
config.module!.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /(node_modules)/
})
config.devtool = '#source-map' // 添加此行代码
// 表示在开发模式的 client 端启用 source-map
}
}
(来源摘自互联网示例,作者 未知)
在代码中添加 debugger 声明
async asyncData({ params, query, $axios,route, error }) {
debugger
$axios.all([
$axios.get('/v2/disease/footer_recommend'),
$axios.get('/v2/hospital/recommend/rand'),
]).
...
在浏览器的开发者工具中调试
No categories