Mobile debugging tool—vConsole

vConsole

vConsole is a lightweight, extensible debugging panel for front-end developers. It is specially designed for mobile web pages to help developers carry out development and debugging work more conveniently.

Features are as follows:
View console logs
View network requests
Manually execute JS command line

use

  1. Installnpm install -D vconsole

  2. Create a utils folder in the src/assets directory and create a new file vconsole.js in it

   import Vconsole from 'vconsole'
   export default new Vconsole()
  1. Reference, can be referenced globally in main.js
 if (process.env.VUE_APP_MODE !== 'production') {
    
    
	require('@/assets/utils/vconsole')
  }
  1. The vconsole control will appear on the startup project page.
    Insert image description here

5.Principle

(1) Rewrite the console

(2) Use window.onerror to capture and report Js errors

Guess you like

Origin blog.csdn.net/kiscon/article/details/115279471