<script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script><script>// VConsole 默认会挂载到 `window.VConsole` 上window.vConsole = new window.VConsole({defaultPlugins: ['system', 'network', 'element', 'storage'],// 可以在此设定要默认加载的面板maxLogNumber: 1000,// disableLogScrolling: true,onReady: () => {console.log('vConsole: onReady');},onClearLog: () => {console.log('vConsole: onClearLog');}});</script>
uniapp的小程序开启调试模式,会看到项目的console.log,但是h5的话手机访问报错时看不到console.log,使用上方代码h5也可以看到调试效果了