datadump
V2EX  ›  Vue.js

vue 项目单步调试还是 console.log?

  •  
  •   datadump ·
    PRO
    · Aug 15, 2022 · 3320 views
    This topic created in 1544 days ago, the information mentioned may be changed or developed.
    我自己的水平:会做最简单的 vue 项目。请教了几个有经验的前端程序员,都是用 log 调试。

    在一些 vue 项目( vite 或者 webpack )设置 sourcemap ,vs 里面基本上单步正常的,但是遇到复杂的 sourcemap 就乱了。

    大家都不用单步调试吗?
    12 replies  •  2022-08-16 10:34:41 +08:00
    tramm
    tramm
    Aug 15, 2022
    1
    我不是前端, 偶尔也写 Vue. 不得不说, 前端的 debug 真的好麻烦
    lmshl
    lmshl
    Aug 15, 2022❤️1
    2
    函数式风格的基本上 console.log 就够用了,读一遍以后脑子里就形成执行模式,然后在几个点位插入 console.log
    命令式风格的得反复 debug ,盯着变量看,一不小心就被改飞了
    murmur
    murmur
    Aug 15, 2022
    3
    debugger+console.log

    chrome sourcemap 的断点一直很烦
    dcsuibian
    dcsuibian
    Aug 15, 2022
    4
    debugger
    FrankFang128
    FrankFang128
    Aug 15, 2022
    5
    单步调试效率低体验好,log 调试效率高体验差。
    wangtian2020
    wangtian2020
    Aug 15, 2022❤️1
    6
    基本不用 debugger
    console.log + [Vue.js devtools] chrome 插件
    callv
    callv
    Aug 15, 2022
    7
    vue devtools 边操作边看状态变更。一般用 console.log ,偶尔 debugger 。
    zhuweiyou
    zhuweiyou
    Aug 15, 2022
    8
    devtools 看 vue state 的变化就行了
    creanme
    creanme
    Aug 15, 2022
    9
    chrome 开发者工具->source 里面可以单步调试啊
    musi
    musi
    Aug 15, 2022
    10
    混着用啊,为啥非要局限一种调试方法
    Zzzz77
    Zzzz77
    Aug 16, 2022
    11
    console.log 真的够用了,之前看 antfu 直播,也有人问这个问题,他说他也是只用 console 的
    datadump
    datadump
    OP
    PRO
    Aug 16, 2022
    12
    感谢大家~~~
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1020 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 18:50 · PVG 02:50 · LAX 10:50 · JFK 13:50
    ♥ Do have faith in what you're doing.