Commit 6fedada4 by qinjianhui

fix: 问题修改

parent 2f578134
import { ref } from "vue" import { ref } from 'vue'
export default function useImagePreview() { export default function useImagePreview() {
const show = ref(false) const show = ref(false)
...@@ -11,7 +11,7 @@ export default function useImagePreview() { ...@@ -11,7 +11,7 @@ export default function useImagePreview() {
div.appendChild(img) div.appendChild(img)
document.body.appendChild(div) document.body.appendChild(div)
const mouseoverImg = (ev: MouseEvent, url: string) => { const mouseoverImg = (ev: MouseEvent, url: string) => {
console.log(url,ev.clientY,ev.clientX) console.log(url, ev.clientY, ev.clientX)
ev.preventDefault() ev.preventDefault()
if (show.value === true) return if (show.value === true) return
img.src = url img.src = url
...@@ -20,7 +20,7 @@ export default function useImagePreview() { ...@@ -20,7 +20,7 @@ export default function useImagePreview() {
const cH = document.body.clientHeight const cH = document.body.clientHeight
const cX = ev.clientX const cX = ev.clientX
const cY = ev.clientY const cY = ev.clientY
let x, y let x: number, y: number
if (cY + 150 >= cH) y = cY - 300 if (cY + 150 >= cH) y = cY - 300
else y = cY - 150 else y = cY - 150
if (cX + 300 >= cW) x = cX - 300 if (cX + 300 >= cW) x = cX - 300
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment