当前位置:网站首页>Debug H5 page -vconsole
Debug H5 page -vconsole
2022-06-29 09:04:00 【CamilleZJ】
vConsole It's a light weight 、 Scalable 、 Debugging panel for front-end developers of mobile web pages .
git Address :https://github.com/Tencent/vConsole
The demo case :http://wechatfe.github.io/vconsole/demo.html
characteristic
- see console journal
- View network requests
- view pages element structure
- see Cookies、localStorage and SessionStorage
- Do it manually JS Command line
- Custom plug in
Use
stay html Page in , For multiple pages, it is necessary to introduce
1、cdn:
<script src="https://cdn.bootcss.com/vConsole/3.2.0/vconsole.min.js"></script>
<script>
var vConsole = new VConsole();
console.log("hello world");
</script>2、npm:
npm install vconsoleImport dist/vconsole.min.js to your project(node_modules The position in is vconsole Under the dist Catalog )

<script src="path/to/vconsole.min.js"></script>
<script>
// init vConsole
var vConsole = new VConsole();
console.log('Hello world');
</script>For TypeScript users:
import 'path/to/vconsole.min.d.ts';3、 Modular introduction import / require etc.
import VConsole from 'vconsole'
const vConsole = new VConsole()4、webpack plugin
npm install vconsole-webpack-plugin --save-devstay webpack Configuration in profile :
// Introducing plug-ins
var vConsolePlugin = require('vconsole-webpack-plugin');
module.exports = {
...
plugins: [
new vConsolePlugin({
filter: [], // Entry file to be filtered
enable: true // Remember to change back to before publishing the code false, Set in development mode true
}),
...
]
...
}Be careful : The debug mode user will see the panel , For development environments only , Do not introduce... Into the production environment vConsole modular .
Support 5 There are different types of logs , It will be output to the front panel in different colors :
console.log("hello world"); // Black characters on white background
console.info("hello world"); // Purple characters on white background
console.debug("hello world"); // Yellow on a white background
console.warn("hello world"); // Yellow characters on yellow background
console.error("hello world"); // The scarlet letter on a red background introduce vConsole After module , The front of the page will appear in the lower right corner vConsole Hover button , Expandable / Fold up the panel :
Expand the panel as follows :

Public properties and methods
// At present vConsole Version number of .
vConsole.version
// Show vConsole Main panel
vConsole.show()
// hide vConsole Main panel
vConsole.hide()
// Destruct a vConsole Object instances , And will vConsole Remove panel from page .
var vConsole = new VConsole();
vConsole.destroy();
// Show vConsole On / off button of .
vConsole.showSwitch()
// hide vConsole On / off button of
vConsole.hideSwitch()
边栏推荐
- JS获取图片或base64的宽高等基本信息
- The final of the sixth season of 2022 perfect children's model Hefei division came to a successful conclusion
- Is it safe for the top ten securities companies to open accounts? Is it reliable?
- MySQL的分库分表策略及应用场景
- P4769-[NOI2018]冒泡排序【组合数学,树状数组】
- Uniapp wechat applet reports an error typeerror: cannot read property 'call' of undefined
- hostname -f与uname -n的返回值可能不同
- Cdga | what is the core of digital transformation in the transportation industry?
- 记一些笔试题
- Compare homekit, MI family, and zhiting family cloud edition for what scene based experiences
猜你喜欢

Let's make a summary

General multiplier design, verilog code

Enrollment brochure for system integration project management engineer certification in July 2022

Mqtt second session -- emqx high availability cluster implementation

机器人代码生成器之Robcogen使用教程

The final of the sixth season of 2022 perfect children's model Hefei division came to a successful conclusion

Unity C # e-learning (12) -- protobuf generation protocol

【无标题】

Verilog size and +: Using

New paid Tarot calculation source code (with building tutorial)
随机推荐
Development tips - Image Resource Management
闭关修炼(二十一)Servlet生命周期、service方法源码分析、线程安全问题
一般乘法器设计,verilog code
查找字符串中重复次数最多的元素
MYSQL虚拟列
802.11--802.11n protocol phy
MT-yolov6训练及测试
MySQL virtual column
CDGA|交通行业做好数字化转型的核心是什么?
十大券商账号开户安全吗?是靠谱的吗?
2022第六季完美童模 合肥賽區 决賽圓滿落幕
2022春夏系列 KOREANO ESSENTIAL重塑时装生命力
Verilog 大小端以及 +:使用
(III) encoder self attention mask
[untitled]
General multiplier design, verilog code
cokkie和session的区别
2022第六季完美童模 合肥赛区 决赛圆满落幕
La finale de la zone de compétition Hefei de la sixième saison 2022 a été couronnée de succès.
Scenario analysis of deadlock during MySQL insert