Fix BboxOverlay inline handler breaking production build
Vue template compiler in production mode rejects multi-statement inline handlers without semicolons. Extract to a named function.
This commit is contained in:
parent
226ae5994e
commit
76e8c55b7c
1 changed files with 6 additions and 4 deletions
|
|
@ -20,10 +20,7 @@
|
|||
ref="canvasRef"
|
||||
class="overlay-canvas"
|
||||
@mousemove="onMouseMove"
|
||||
@mouseleave="
|
||||
hoveredElement = null
|
||||
emit('highlight-element', -1)
|
||||
"
|
||||
@mouseleave="onMouseLeave"
|
||||
/>
|
||||
<div v-if="hoveredElement" class="tooltip" :style="tooltipStyle">
|
||||
<span
|
||||
|
|
@ -158,6 +155,11 @@ function draw(): void {
|
|||
}
|
||||
}
|
||||
|
||||
function onMouseLeave(): void {
|
||||
hoveredElement.value = null
|
||||
emit('highlight-element', -1)
|
||||
}
|
||||
|
||||
function onMouseMove(e: MouseEvent): void {
|
||||
const canvas = canvasRef.value
|
||||
const img = props.imageEl
|
||||
|
|
|
|||
Loading…
Reference in a new issue