Cov txheej txheem:

Yuav ua li cas ntxiv ib qho kev hloov pauv hauv Chrome?
Yuav ua li cas ntxiv ib qho kev hloov pauv hauv Chrome?

Video: Yuav ua li cas ntxiv ib qho kev hloov pauv hauv Chrome?

Video: Yuav ua li cas ntxiv ib qho kev hloov pauv hauv Chrome?
Video: Tsis Muaj Peev Xwm Yuav Ua Li Cas 2024, Kaum ib hlis
Anonim

Txhawm rau teeb tsa ib qho kev cai kab-ntawm-code breakpoint:

  1. Nyem qhov Sources tab.
  2. Qhib cov ntaub ntawv uas muaj cov kab code uas koj xav kom tawg.
  3. Mus rau kab ntawm code.
  4. Nyob rau sab laug ntawm kab code yog kab zauv kab.
  5. Xaiv Ntxiv qhov xwm txheej breakpoint .
  6. Nkag mus rau koj mob hauv dialog.

Raws li txoj cai, ua li cas koj ncua kev thauj khoom ntawm Google Chrome?

Chrome DevTools: Yooj yim nres ntawm JavaScript code yam tsis muaj manually teem breakpoints. Koj tuaj yeem yooj yim nres Tam sim no tsab ntawv ua tiav nrog cov keyboard shortcuts: Mac: F8 lossis Command + Windows: F8 lossis Control +

Qhov thib ob, koj siv lub breakpoint li cas? Teeb cov ntsiab lus nyob rau hauv qhov chaws code To teeb a breakpoint nyob rau hauv qhov chaws code, nyem rau ntawm sab laug sab laug ntawm ib sab ntawm kab ntawv. Koj tuaj yeem xaiv kab thiab nias F9, xaiv Debug> Toggle Breakpoint , los yog right-click thiab xaiv Breakpoint > Ntxig breakpoint . Cov breakpoint tshwm raws li ib tug liab dot nyob rau sab laug margin.

Kuj tseem yuav paub, dab tsi yog qhov kev hloov pauv raws cai?

A conditional breakpoint yog tshwm sim raws li ib qho kev qhia tshwj xeeb ntsuas ntawm lub teeb liab. Thaum lub breakpoint yog tshwm sim, lub simulation pauses. Teeb cov ntsiab lus breakpoints kom nres Simulation Stepper thaum lub sijhawm teev tseg mob yog ntsib.

Yuav ua li cas koj teem ib breakpoint nyob rau hauv tshuaj ntsuam xyuas?

Event-Based Breakpoints Los yog peb muaj peev xwm right-click thiab xaiv Tshawb xyuas (Ctrl + Ua haujlwm + Kuv). Mus rau Sources tab thiab nthuav dav Event Listener Breakpoints ntu. Peb tuaj yeem pom cov xwm txheej sib txawv uas tau teev tseg hauv ntu xws li Keyboard, Ntaus, Nas, thiab lwm yam. Nthuav lub npov nas thiab xaiv lub npov nias.

Pom zoo: