浏览器端如何使用VConsole.js调试代码?

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>VConsole</title>
</head>
<body>
<script src='https://wechatfe.github.io/vconsole/lib/vconsole.min.js?v=3.0.0.0'></script>
<script type="text/javascript">
	window.vConsole = new window.VConsole();
	window.onerror = function(errorMessage, scriptURI, lineNumber,columnNumber,errorObj) {
	   console.log("错误信息:" , errorMessage);
	   console.log("出错文件:" , scriptURI);
	   console.log("出错行号:" , lineNumber);
	   console.log("出错列号:" , columnNumber);
	   console.log("错误详情:" , errorObj);
	}
	throw new Error("出错了!");
</script>
</body>
</html>
posted @ 2019-01-11 12:19  心无引擎,眼无流派  阅读(3374)  评论(0编辑  收藏  举报