|
|
@ -38,6 +38,8 @@ export default defineNuxtPlugin((nuxtApp) => { |
|
|
|
document.documentElement.addEventListener('mouseup', stopDrag, false) |
|
|
|
document.documentElement.addEventListener('mouseup', stopDrag, false) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;(el as any).initDrag = initDrag |
|
|
|
|
|
|
|
|
|
|
|
let width: number | string |
|
|
|
let width: number | string |
|
|
|
|
|
|
|
|
|
|
|
// emit event on dragging
|
|
|
|
// emit event on dragging
|
|
|
@ -56,5 +58,12 @@ export default defineNuxtPlugin((nuxtApp) => { |
|
|
|
emit('xcresized') |
|
|
|
emit('xcresized') |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
beforeUnmount: (el: Element) => { |
|
|
|
|
|
|
|
const resizer = el.querySelector('.resizer') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (resizer) { |
|
|
|
|
|
|
|
resizer.removeEventListener('mousedown', (el as any).initDrag, false) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|