# How to debug custom plugins

This chapter describes how to debug custom plug-ins, which can help developers quickly locate problems.

# premise

Before learning how to debug custom plugins, you need to know:

  1. Custom components are developed based on javascript system

# debugging tools

It is recommended to use the chrome browser and the devtools tools provided by the browser for debugging (other non-webkit core browsers also have tools with the same functions, but the usage is slightly different). For specific usage, click here (opens new window)to learn.

# Debug JS

Open the console can be used, macOS: cmd + option + i or right click "check"; Window: F12 or right click "check".

# Output key data through console.log.

Add console.log to the source code

plugin-senior-how-debug-1

View data through the console panel

plugin-senior-how-debug-2

# Output key data through alert.

Add alert to source code

plugin-senior-how-debug-3

View data in view

plugin-senior-how-debug-4

# Debugging through source code

Find the source code through the source panel

plugin-senior-how-debug-5

Click on the line number to make a breakpoint

plugin-senior-how-debug-6

Refresh line details trigger breakpoint

plugin-senior-how-debug-7

lastUpdate: 10/24/2022, 3:40:37 PM