Demo 在线地址:
https://sx00xs.github.io/test/37/index.html
---------------------------------------------------------------
ide: vscode
文件格式:.vue
解析:(待补)
<template> <pre v-pre> <script type="text/javascript"> var event = event || window.event; alert("坐标:[" + event.clientX + ", " + event.clientY + "]") </script> </pre> </template> <script> export default { name:'Navs', methods:{ handleClick(event){ alert("坐标:[" + event.clientX + ", " + event.clientY + "]") } }, mounted(){ document.addEventListener('click',this.handleClick) } } </script>