Skip to content

如何监听事件

支持的事件列表

示例

ts
import ImageMark from 'mark-img'

const imgMark = new ImageMark({
	el: '#container',
	src: '/public/img/demo-parking.jpg',
	pluginOptions: {
		shape: {
			shapeList: [],
		},
	},
})
	//监听shape添加事件
	.on('shape_add', (data: ShapeData, shapeInstance: ShapeInstance) => {
		// do something
	})