Git Product home page Git Product logo

vue-avatar-tailor's Introduction

vue-avatar-tailor组件

vue,头像裁剪组件,可对上传的图片用九宫格进行简单的裁剪

运行效果

示例运行步骤

  • 【下载依赖】npm install
  • 【运行项目】npm run dev
  • 【打开对应链接】浏览器打开对应链接
  • 【设置top值示例】http://127.0.0.1:8080/#/

源代码

  • /src/App.vue是使用头像裁剪组件的代码实例

  • 组件源代码为/src/components/avatar-cutter/avatar-cutter.vue,拷贝整个/src/components/avatar-cutter文件夹使用即可

    源代码

使用方法如下

<avatar-cutter
  v-if="showCutter"
  return-type="url" // uploadAvatar回调函数返回的数据类型,'url'返回图片链接,'file'返回封装好的文件数据
  @cancel="showCutter = false"
  @enter="uploadAvatar" // 裁剪完成后的回调函数
>
</avatar-cutter>

组件原理及详细介绍,请移步这个文章

vue-avatar-tailor's People

Contributors

momo707577045 avatar wangluolin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vue-avatar-tailor's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.