<button @click="getMouseXY($event)">点击获取鼠标坐标</button>
            getMouseXY(e){
                this.x = e.x //获取鼠标的X坐标(鼠标与屏幕左侧的距离,单位为px)
                this.y = e.y //获取鼠标的Y坐标(鼠标与屏幕顶部的距离,单位为px)
            },

 

Logo

前往低代码交流专区

更多推荐