1.0.0 • Published 5 years ago

vue-cropbalg v1.0.0

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

vue-cropblg

vue 图片裁剪插件

Installation

$ npm install vue-cropblg
$ yarn add vue-cropblg

Usage

<template>
   <crop/>
   ...
</template>

组件内引入
import { crop } from "vue-cropblg";
 ...
components: {
  crop
},
 
全局引入
import crop from "vue-cropblg";
Vue.use(crop)

API

Attributes

参数说明类型可选值默认值
v-model组件Object----
position水印位置大小x,y,sizeArray--'90%', '90%',1

Methods

方法名说明参数
changeImage改变处理图片,如果没有传imgAddress,会打开本地Function(imgAddress: String
getImage获取处理后图片,返回Promise,可以选择返回 base64和bolb,quality为文件压缩比Function(type:Base64Bolb, mimeType:image/jpegimage/png, quality:Number

Slot

name说明
placeholder没有图片时占位图
initial默认处理图片
watermark水印(图片或者文字)