This commit is contained in:
zdg 2024-09-21 12:05:46 +08:00
parent 9ff824e082
commit 6935bec1e4
1 changed files with 15 additions and 5 deletions

View File

@ -1,9 +1,15 @@
<template> <template>
<canvas ref="canvasRef" /> <canvas ref="canvasRef" style="pointer-events: none;" />
<button @click="eraseTo">橡皮擦 <div style="position: absolute;top: 0;" @click="test('click')"
<i class="iconfont icon-xiangpica"></i> @mouseenter="test('mouseenter')" @mousemove="test('mousemove')" @mouseleave="test('mouseleave')"
</button> @touchstart="test('touchstart')" @touchmove="test('touchmove')" @touchend="test('touchend')"
<button @click="close">销毁</button> @touchcancel="test('touchcancel')" @mousedown="test('mousedown')" @mouseup="test('mouseup')"
@mouseout="test('mouseout')" @mouseover="test('mouseover')" @mousewheel="test('mousewheel')">
<!-- <button @click="eraseTo">橡皮擦</button> -->
<!-- <i class="iconfont icon-xiangpica"></i> -->
<!-- <button @click="close">销毁</button> -->
<div style="width: 100px;height: 100px;background: #ffbcbc;">小星星</div>
</div>
</template> </template>
<script setup> <script setup>
@ -43,6 +49,10 @@ const eraseTo = () => { // 橡皮擦
// canvas.dispose() // canvas.dispose()
} }
const close = () => { FabricVue.removeCanvas() } const close = () => { FabricVue.removeCanvas() }
const test = (key, e) => {
console.log('event: ', key)
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>