# vue-picture-bd-marker

> 关于ui-picture-bd-marker插件的Vue封装

Latest version **1.5.1-alpha-1150** (published 2023-04-07) · Apache-2.0 License license · 0 weekly downloads

## Install

```sh
npm install vue-picture-bd-marker
pnpm add vue-picture-bd-marker
yarn add vue-picture-bd-marker
bun add vue-picture-bd-marker
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.5.1-alpha-1150 |
| Published | 2023-04-07 |
| First published | 2018-11-24 |
| Weekly downloads | 0 |
| License | Apache-2.0 License |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 18.8 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 58 |
| Author | freddon |
| Maintainers | fabyuxuan |
| Keywords | marker, 画, 打标签, 图像画框, 标签, 标注 |

## Links

- npm: https://www.npmjs.com/package/vue-picture-bd-marker
- Repository: https://github.com/sunshengfei/vue-vmarker
- Homepage: https://github.com/sunshengfei/vue-vmarker#readme
- Issues: https://github.com/sunshengfei/vue-vmarker/issues
- npm.io page: https://npm.io/package/vue-picture-bd-marker

## Dependencies (4)

- [vue](https://npm.io/package/vue.md) ^2.6.11
- [core-js](https://npm.io/package/core-js.md) ^3.6.5
- [eslint-plugin-vue](https://npm.io/package/eslint-plugin-vue.md) ^7.12.1
- [ui-picture-bd-marker](https://npm.io/package/ui-picture-bd-marker.md) ^2.3.8

## Recent versions

- 1.5.1-alpha-1150 (latest) — 2023-04-07
- 1.5.0 — 2023-04-06
- 1.4.6 — 2022-01-11
- 1.4.5 — 2021-09-04
- 1.4.3 — 2021-07-20
- 1.4.2 — 2021-07-05
- 1.4.1-beta02 — 2021-06-02
- 1.4.1 — 2021-01-07
- 1.4.0 — 2021-01-07
- 1.3.8 — 2020-10-17
- 1.3.7 — 2020-07-13
- 1.3.6 — 2020-07-11
- 1.3.5 — 2020-07-03
- 1.3.3 — 2020-04-02
- 1.3.1 — 2019-11-01
- … 8 more at https://npm.io/package/vue-picture-bd-marker/versions

## README

# vue-picture-bd-marker

![](https://img.shields.io/github/license/sunshengfei/vue-ui-picture-bd-marker) ![](https://img.shields.io/npm/v/vue-picture-bd-marker.svg?color=%23ff4400&style=popout)


```
npm i vue-picture-bd-marker

```


效果图：

![](https://github.com/sunshengfei/ui-picture-bd-marker/blob/master/demo.png?raw=true)


> 关于[ui-picture-bd-marker](https://www.npmjs.com/package/ui-picture-bd-marker)插件的Vue组件封装
 
github仓库地址：[https://github.com/sunshengfei/vue-ui-picture-bd-marker](https://github.com/sunshengfei/vue-ui-picture-bd-marker)

文档地址：[https://vmarker.sagocloud.com/](https://vmarker.sagocloud.com/about/)


更新说明
---

## 1.5.0

---
增加config属性：
```
v-bind:config="{ closable: true }"
```
config接收的值和默认值如下，参见 ui-picture-bd-marker => [https://github.com/sunshengfei/ui-picture-bd-marker/blob/master/src/config.js](https://github.com/sunshengfei/ui-picture-bd-marker/blob/master/src/config.js)

```
        deviceType: 'both',//both | mouse | touch
        blurOtherDots: false,
        blurOtherDotsShowTags: false,
        editable: true,
        readOnlyCanSelected: true,
        readOnlyAcceptEvent: ['mousedown', 'mouseup', 'touchstart', 'touchup'],
        showTags: true,
        closable: true, 
        supportDelKey: false,
        tagLocation: defaultPositions.bottom,
        trashPositionStart: 0,
        boundReachPercent: 0.01,
        textComponent: () => undefined,
        annotationClass: 'annotation',
```


## 1.4.5
---
1、支持长图模式，外部可以套div进行overflow，只需要在vue组件设置width和ratio组合值即可
   1. width:auto 容器宽度将会使用原有图像宽度
   2. ratio:0    使用原图像缩放比
2、修复github issues的一些bug
3、外层增加class `g-handler-touchable`将开启，响应式touch handler外形变化

## 1.4.3
---
1、增加`@vmarker:onSize="onSize"`事件，返回区域大小与位置


## 1.4.2
---
1、提升`ui-picture-bd-marker`最低版本
2、修复readonly属性响应失效问题


## v1.3.8

同步更新`ui-picture-bd-marker`修复的bug


## v1.3.7

删除@vmarker:onSelect、@vmarker:onDrawOne事件

```
<AiPanel
      ref="aiPanel-editor"
      class="ai-observer"
      :ratio="ratio"
      v-bind:uniqueKey="1"
      @vmarker:onAnnoSelected="onAnnoSelected"
      @vmarker:onAnnoAdded="onAnnoAdded"
      @vmarker:onUpdated="onUpdated"
      @vmarker:onReady="onAiPanelReady"
      @vmarker:onImageLoad="onImageLoad"
      v-bind:readOnly="false"
      v-bind:imgUrl="currentImage"
    />
```
可以通过this.$refs["aiPanel-editor"].getMarker().updateConfig(config)更新配置，vue-marker内部config默认如下

```
config = {
      options: {
        blurOtherDots: true,
        blurOtherDotsShowTags: true,
        editable: this.readOnly ? false : true,
        trashPositionStart: 1
      },
      onAnnoContextMenu: function(annoData, element, annoContext) {
        // console.log("🦁onAnnoContextMenu🦁 data=", annoData);
        self.$emit("vmarker:onAnnoContextMenu", annoData, element, self.key);
      },
      onAnnoRemoved: function(annoData) {
        // console.log("🦁onAnnoRemoved🦁 data=", annoData);
        self.$emit("vmarker:onAnnoRemoved", annoData, self.key);
        return true;
      },
      onAnnoAdded: function(insertItem, element) {
        // console.log("🦁onAnnoAdded🦁 data=", insertItem);
        self.$emit("vmarker:onAnnoAdded", insertItem, self.key);
      },
      onAnnoChanged: function(newValue, oldValue) {
        // console.log("🦁onAnnoChanged🦁 ", newValue, oldValue);
        self.$emit("vmarker:onAnnoChanged", newValue, oldValue, self.key);
      },
      onAnnoDataFullLoaded: function() {
        // console.log("🦁onAnnoDataFullLoaded🦁 data=", self.key);
        self.$emit("vmarker:onAnnoDataFullLoaded", self.key);
      },
      onAnnoSelected: function(value, element) {
        // console.log("🦁onAnnoSelected🦁 data=", value);
        self.$emit("vmarker:onAnnoSelected", value, element, self.key);
      },
      onUpdated: function(data) {
        self.$emit("vmarker:onUpdated", data, self.key);
      }
    };
```

内部可配置defaultConfig如下：
```
const defaultConfig = {
    options: {
        deviceType: 'both',//both | mouse | touch
        blurOtherDots: false,
        blurOtherDotsShowTags: false,
        editable: true,
        showTags: true,
        supportDelKey: false,
        tagLocation: defaultPositions.bottom,//1 2
        trashPositionStart: 0,
        boundReachPercent: 0.01,
        annotationClass: 'annotation',
    },
    onAnnoContextMenu: function (annoData, element, annoContext) { },
    onAnnoRemoved: function (annoData, element) { return true },
    onAnnoAdded: function (insertItem, element) { },
    onAnnoChanged: function (newValue, oldValue) { },
    onAnnoDataFullLoaded: function () { },
    onAnnoSelected: function (value, element) { },
    onUpdated: function () { },
};
```

## v1.3.5

1. 增加Mobile支持
2. 修复键盘删除键失效问题

## v1.3.0

1. 重新适配`ui-picture-bd-marker@2.0.0`
2. 修复ratio默认不生效问题。（[issue#3](https://github.com/sunshengfei/ui-picture-bd-marker/issues/3) ）

## v1.2.1

> 注意：不兼容1.0.x版本

1. 防止事件名称冲突，更改emit回调事件名称前缀`vmarker`,如:`this.$emit("vmarker:onReady", this.key);`
2. 增加修改config更改后画布自动刷新机制

---
_Source: https://npm.io/package/vue-picture-bd-marker · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
