一:
<script src="https://g.alicdn.com/code/lib/vConsole/3.3.4/vconsole.min.js"></script>
<script>
console.log(new VConsole());
</script>
二:
<script src="//cdn.bootcss.com/eruda/1.4.2/eruda.min.js"></script>
<script>
eruda.init({
container: el,
tool: ['console', 'elements'],
useShadowDom: true
});
</script>
或者用户体验考虑。动态配置是否显示调试工具
var src = 'https://cdn.bootcss.com/eruda/1.3.2/eruda.min.js';
document.write('<scr' + 'ipt src="' + src + '"></scr' + 'ipt>');
document.write('<scr' + 'ipt>eruda.init();</scr' + 'ipt>');