vconsole自定义插件,tutorial上都是继承VConsolePlugin,但这个插件是最基础的,没有Log tab上的All Log Info Warn 等按钮,也没有Clear Hide按钮。
翻了一下源码,除了VConsolePlugin,还有VConsoleLogPlugin、VConsoleDefaultPlugin、VConsoleSystemPlugin、VConsoleNetworkPlugin、VConsoleElementPlugin、VConsoleStoragePlugin。除了VConsoleDefaultPlugin,其余的5个Plugin分别对应日志tab下的5个按钮,试了一下继承VConsoleDefaultPlugin,果然Log下的样式有了
PS:如果想修改Network plugin下的返回,比如做加解密,可以重写tool下面的htmlEncode方法
var vConsole = new VConsole();
vConsole.tool.htmlEncode = function(text) {
//TODO
return document.createElement('a').appendChild( document.createTextNode(text)).parentNode.innerHTML;
}