当前位置:网站首页>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()
边栏推荐
- Verilog 大小端以及 +:使用
- Product manager certification enrollment brochure (NPDP) in July 2022
- Uber前安全主管面临欺诈指控 曾隐瞒数据泄露事件
- 闭关修炼(二十一)Servlet生命周期、service方法源码分析、线程安全问题
- 工作好多年,回忆人生--高中三年
- uniapp微信小程序报错 TypeError: Cannot read property ‘call‘ of undefined
- MYSQL行转列例子
- P4769-[noi2018] bubble sort [combinatorics, tree array]
- Did you really make things clear when you were promoted or reported?
- 在 golang 中是如何对 epoll 进行封装的?
猜你喜欢

Compare homekit, MI family, and zhiting family cloud edition for what scene based experiences

【无标题】

Tutorial on building open source Internet of things platform

Matlab usage

手写VirtualDOM

抽象类、接口

Core development board & debugger

工厂模式

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

微积分学习
随机推荐
Is the securities account of qiniu school really safe and reliable?
积分商城运营要如何做才能获取到利润
Multiplier design (pipeline) Verilog code
Open3D 隐藏点移除
Mqtt second session -- emqx high availability cluster implementation
(pytorch进阶之路三)encoder self attention mask
MySQL virtual column
H5软键盘问题
2022第六季完美童模 海口赛区 选拔赛圆满落幕
Scenario analysis of deadlock during MySQL insert
工厂模式
【无标题】
mongoDB 持久化
Open3D 最远点采样(FPS)
hostname -f与uname -n的返回值可能不同
搭建开源物联网平台教程
Verilog data type
【最全】PS各个版本下载安装及小试牛刀教程(PhotoShop CS3 ~~ PhotoShop 2022)
ES6数据类型Map&Set
DevOps到底是什么意思?