项目
在 GitHub 查看
Agontuk/vue-cropperjs
关于
用于 cropperjs 的 Vue 封装组件:https://github.com/fengyuanchen/cropperjs
网站与应用开发实测星标增长
- 24小时
- 0
- 7天
- -1
- 15天
- -1
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文vue-cropperjs
A Vue wrapper component for cropperjs.
Demo
Checkout here agontuk.github.io/vue-cropperjs
Installation
npm install --save vue-cropperjs
or
yarn add vue-cropperjs
You will also need css & style loader for webpack
Compatibility
| Vue Version | Package Version |
|---|---|
| 3.x.x | >=5.0.0 |
| 2.x.x | 4.2.0 |
| 1.x.x | 1.0.3 |
Usage
// Global
import Vue from 'vue';
import VueCropper from 'vue-cropperjs';
import 'cropperjs/dist/cropper.css';
Vue.component(VueCropper);
// Local
import VueCropper from 'vue-cropperjs';
import 'cropperjs/dist/cropper.css';
export default {
components: { VueCropper}
}
...
<vue-cropper
ref="cropper"
:src="imgSrc"
alt="Source Image"
@ready="..."
@cropstart="..."
@cropmove="..."
@cropend="..."
@crop="..."
@zoom="..."
>
</vue-cropper>
...
this.$refs.cropper.rotate(45);
See the example files & cropperjs documentation
Options
| Name | Type | Required | Description |
|---|---|---|---|
| src | string |
-- | Image source |
| containerStyle | object |
-- | Styling for the image container |
| imgStyle | object |
-- | Styling for the image |
| alt | string |
-- | Alternate text for the image |
Crop related options
See cropperjs documentation for all posible options & methods.
Renamed Methods
relativeZoomfromzoominitCropfromcrop
License
MIT
探索相关项目
加载中…
