0.1.6 • Published 2 years ago

vue-pic-marker v0.1.6

Weekly downloads
47
License
-
Repository
-
Last release
2 years ago

安装和使用

npm install vue-pic-marker

import Vue from 'vue'

import VuePicMarker from 'vue-pic-marker';
Vue.use(VuePicMarker);
<VuePicMarker img-url="images/1.jpg" width="800"></VuePicMarker>

props

参数类型说明默认
img-urlString图片路径
read-onlyBoolean是否只读false
unique-keyBoolean识别控件唯一性,当页面存在多个控件时需要区分
show-gridBoolean是否显示网格false
widthString, Number图片宽度100%
heightString, Number图片高度auto
allow-drag-addBoolean是否允许拖拽添加标记true
allow-click-addBoolean是否允许点击添加标记true
dot-sizeNumber点击添加标记的大小20
commentBoolean是否启用评论功能true

event

事件名说明参数
image-load图片加载完成后回调rawW,rawH,currentW,currentH
data-rendered当标注框主动渲染数据后时回调uniqueKey
updated当标注框位置或者标框属性发生改动data, movement, uniqueKey
draw当画完一个标注框时回调data, movement, uniqueKey
context-menu右键点击事件event, data, node, uniqueKey
remove标注删除事件data, node, uniqueKey

methods

方法名说明参数返回值
getMarker返回marker对象marker
renderData加载主动渲染数据data
clearData清空所有标注
setTag设置当前选中标注内容tagObj
setType设置绘制的标注类型,会为绘制的标注加上该css classtypeName
0.1.6

2 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago