4
2

More than 1 year has passed since last update.

フロントエンドのDebug方法

Posted at
1 / 12

ロジックの確認

console.log を使います

console.log("Hogehoge")
  • 一番簡単Debugger方法、consoleにデータを表示するコード

image.png

image.png


console.traceを使います

console.trace('ここまでの処理');
  • logまでの実行した経路が表示されます。
    image.png

Debugger

debugger

- ロジック実行途中に止めたい場合、debugger を使います。

image.png
image.png

  • 止めるときに、実行途中のデータが見えます。

image.png


Breakpoint

  • Browserの検証モードでBreakpoint設定できます。
  • Step by Stepのdebug

image.png

image.png


UIのDebugger

Css computed

  • style computedで現在有効しているスタイルが確認できます。
  • 有効しているスタイルはどこに設定しているか確認できます。
  • image.png

Css生編集

  • スタイルを直接に確認したい場合、ブラウザで直接にスタイルCSSが設定できます。

image.png


HTML生編集

  • HTMLを直接に確認したい場合、ブラウザで直接に確認できます。

image.png

  • Div移動したり、削除したりもできます。

画面のサイズの確認

image.png
image.png


Vuejs

VueDev tool Extension

https://devtools.vuejs.org/guide/installation.html
https://chrome.google.com/webstore/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd

  • vuejsのコンポネントのデータなどが分かります

image.png


Mobile Vconsole

https://github.com/Tencent/vConsole
http://wechatfe.github.io/vconsole/demo.html

  • モバイルで確認できます。

4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2