Skip to content

使用Vue实现的头像裁剪工具插件, a vue.js plugin to crop avatar

Notifications You must be signed in to change notification settings

ray2004a/avatar-cropper

 
 

Repository files navigation

avatar-cropper

使用Vue实现的头像裁剪工具插件

demo link

web、移动端适配

ok事件返回选择的头像数据(dataurl)

ok event returns selected avatar's data(dataurl)

demo-pc.gif

demo-phone.gif

How to Use

# install this plugin
npm i avatar-cropper --save
// main.js
import avatarCropper from 'avatar-cropper'
Vue.use(avatarCropper)

// xxx.vue
<div id="app">
  <button @click="show = true">更换头像</button>
  <avatar-cropper v-model="show" @ok="data = $event"></avatar-cropper>
  <img :src="data" style="display: block">
</div>

Build Setup

// 修改webpack
// dev 使用
entry: './src/main.js',
// build 使用
entry: './src/plugin/index.js',
# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

For detailed explanation on how things work, consult the docs for vue-loader.

About

使用Vue实现的头像裁剪工具插件, a vue.js plugin to crop avatar

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vue 84.1%
  • JavaScript 14.0%
  • HTML 1.9%