All Projects → dai-siki → Vue Image Crop Upload

dai-siki / Vue Image Crop Upload

A beautiful vue component for image cropping and uploading. (vue图片剪裁上传组件)

Programming Languages

javascript
184084 projects - #8 most used programming language
Vue
7211 projects

Projects that are alternatives of or similar to Vue Image Crop Upload

Thispersondoesnotexist Js
Api for https://thispersondoesnotexist.com Generates an image of a person that does not exist in real life
Stars: ✭ 101 (-94.66%)
Mutual labels:  avatar
Materialabout
It's a material-design about screen to use on your Android apps. A developer profile and application information easy to integrate. 🔖
Stars: ✭ 1,511 (-20.14%)
Mutual labels:  avatar
Fileshelter
FileShelter is a “one-click” file sharing web application
Stars: ✭ 132 (-93.02%)
Mutual labels:  file-upload
Ts3admin.class
The ts3admin.class is a powerful api for communication with Teamspeak 3 Servers from your website! Your creativity knows no bounds!
Stars: ✭ 103 (-94.56%)
Mutual labels:  avatar
Letteravatar
Letter avatar generation for Go
Stars: ✭ 109 (-94.24%)
Mutual labels:  avatar
React File Drop
React component for Gmail or Facebook -like drag and drop file uploader
Stars: ✭ 123 (-93.5%)
Mutual labels:  file-upload
Angular File Uploader
Angular file uploader is an Angular 2/4/5/6/7/8/9/10 + file uploader module with Real-Time Progress Bar, Responsive design, Angular Universal Compatibility, localization and multiple themes which includes Drag and Drop and much more.
Stars: ✭ 92 (-95.14%)
Mutual labels:  file-upload
Filestack Android
Official Android SDK for Filestack - API and content management system that makes it easy to add powerful file uploading and transformation capabilities to any web or mobile application.
Stars: ✭ 140 (-92.6%)
Mutual labels:  file-upload
Avatar
Plug n play avatar, turn name, email, and any other string into beautiful avatar (or gravatar), effortless.
Stars: ✭ 1,525 (-19.4%)
Mutual labels:  avatar
Frequest
FRequest - A fast, lightweight and opensource desktop application to make HTTP(s) requests
Stars: ✭ 130 (-93.13%)
Mutual labels:  file-upload
Meteor Jalik Ufs
Upload File System for Meteor **DISCONTINUED**
Stars: ✭ 103 (-94.56%)
Mutual labels:  file-upload
Minecraft Avatar
PHP script (using GD) to generate avatar or skin from a Minecraft username
Stars: ✭ 104 (-94.5%)
Mutual labels:  avatar
Uppload
📁 JavaScript image uploader and editor, no backend required
Stars: ✭ 1,673 (-11.58%)
Mutual labels:  file-upload
React Activestorage Provider
A React component that allows easy file upload using ActiveStorage
Stars: ✭ 102 (-94.61%)
Mutual labels:  file-upload
Filepond
🌊 A flexible and fun JavaScript file upload library
Stars: ✭ 11,869 (+527.33%)
Mutual labels:  file-upload
Icotar
A free colorful icon avatar generator.
Stars: ✭ 94 (-95.03%)
Mutual labels:  avatar
Avataaars Generator
Simple generator React app for avataaars
Stars: ✭ 2,078 (+9.83%)
Mutual labels:  avatar
Laravel Scaffold
The base for developing awesome projects
Stars: ✭ 142 (-92.49%)
Mutual labels:  avatar
Angular Filemanager
JavaScript File Manager Material Design Folder Explorer Navigator Browser Manager in AngularJS with CSS3 Responsive (with FTP in PHP / Java / Node)
Stars: ✭ 1,693 (-10.52%)
Mutual labels:  file-upload
Depot
Toolkit for storing files and attachments in web applications
Stars: ✭ 125 (-93.39%)
Mutual labels:  file-upload

vue-image-crop-upload

中文文档.

A beautiful vue component for image crop and upload.

Notice: This component is designed for pc, not recommended for use on the mobile side.

GitHub issues GitHub forks GitHub stars Twitter

NPM

Change log

@3.0.0

  • Compatible vue3

Demo

Click me.

Screenshot

screenshot

Brower compatibility

IE10+

Install

npm

$ npm install vue-image-crop-upload

Usage

Props

Name Type Default Description
url String '' Server api path,like "/avatar/upload", If empty, will not be uploaded
method String 'POST' request http method
field String 'upload' Upload input filename, used for server side get the file stream.
value Boolean twoWay show or not
params Object null POST Params,like "{k:v}"
headers Object null POST request header,like "{k:v}"
langType String 'zh' language type
langExt Object language extend
width Number 200 width of receive image
height Number 200 height of receive image
imgFormat string 'png' jpg/png, Server api receive file type.
imgBgc string '#fff' background color, if the imgFormat prop is jpg
noCircle Boolean false disable circle preview
noSquare Boolean false disable square preview
noRotate Boolean true disable rotate function
withCredentials Boolean false support cross-domain

Events

Name Description
srcFileSet Once you've selected the file, params( fileName, fileType, fileSize )
cropSuccess image crop success, params( imageDataUrl, field )
cropUploadSuccess upload success, params( jsonData, field )
cropUploadFail upload fail, params( status, field )

Language package

view details.

Example Of "langExt"

{
    hint: 'Click or drag the file here to upload',
    loading: 'Uploading…',
    noSupported: 'Browser is not supported, please use IE10+ or other browsers',
    success: 'Upload success',
    fail: 'Upload failed',
    preview: 'Preview',
    btn: {
    	off: 'Cancel',
    	close: 'Close',
    	back: 'Back',
    	save: 'Save'
    },
    error: {
    	onlyImg: 'Image only',
    	outOfSize: 'Image exceeds size limit: ',
    	lowestPx: 'Image\'s size is too low. Expected at least: '
    }
}

Example vue@3

<div id="app">
	<a class="btn" @click="toggleShow">set avatar</a>
	<my-upload field="img"
        @crop-success="cropSuccess"
        @crop-upload-success="cropUploadSuccess"
        @crop-upload-fail="cropUploadFail"
        v-model="show"
		:width="300"
		:height="300"
		url="/upload"
		:params="params"
		:headers="headers"
		img-format="png"></my-upload>
	<img :src="imgDataUrl">
</div>

<script>
	import 'babel-polyfill'; // es6 shim
	import Vue from 'vue';
	import myUpload from 'vue-image-crop-upload';

	new Vue({
		el: '#app',
		data: {
			show: true,
			params: {
				token: '123456798',
				name: 'avatar'
			},
			headers: {
				smail: '*_~'
			},
			imgDataUrl: '' // the datebase64 url of created image
		},
		components: {
			'my-upload': myUpload
		},
		methods: {
			toggleShow() {
				this.show = !this.show;
			},
            /**
			 * crop success
			 *
			 * [param] imgDataUrl
			 * [param] field
			 */
			cropSuccess(imgDataUrl, field){
				console.log('-------- crop success --------');
				this.imgDataUrl = imgDataUrl;
			},
			/**
			 * upload success
			 *
			 * [param] jsonData  server api return data, already json encode
			 * [param] field
			 */
			cropUploadSuccess(jsonData, field){
				console.log('-------- upload success --------');
				console.log(jsonData);
				console.log('field: ' + field);
			},
			/**
			 * upload fail
			 *
			 * [param] status    server api return error status, like 500
			 * [param] field
			 */
			cropUploadFail(status, field){
				console.log('-------- upload fail --------');
				console.log(status);
				console.log('field: ' + field);
			}
		}
	});
</script>

Example vue@2

<div id="app">
	<a class="btn" @click="toggleShow">set avatar</a>
	<my-upload field="img"
        @crop-success="cropSuccess"
        @crop-upload-success="cropUploadSuccess"
        @crop-upload-fail="cropUploadFail"
        v-model="show"
		:width="300"
		:height="300"
		url="/upload"
		:params="params"
		:headers="headers"
		img-format="png"></my-upload>
	<img :src="imgDataUrl">
</div>

<script>
	import 'babel-polyfill'; // es6 shim
	import Vue from 'vue';
	import myUpload from 'vue-image-crop-upload/upload-2.vue';

	new Vue({
		el: '#app',
		data: {
			show: true,
			params: {
				token: '123456798',
				name: 'avatar'
			},
			headers: {
				smail: '*_~'
			},
			imgDataUrl: '' // the datebase64 url of created image
		},
		components: {
			'my-upload': myUpload
		},
		methods: {
			toggleShow() {
				this.show = !this.show;
			},
            /**
			 * crop success
			 *
			 * [param] imgDataUrl
			 * [param] field
			 */
			cropSuccess(imgDataUrl, field){
				console.log('-------- crop success --------');
				this.imgDataUrl = imgDataUrl;
			},
			/**
			 * upload success
			 *
			 * [param] jsonData  server api return data, already json encode
			 * [param] field
			 */
			cropUploadSuccess(jsonData, field){
				console.log('-------- upload success --------');
				console.log(jsonData);
				console.log('field: ' + field);
			},
			/**
			 * upload fail
			 *
			 * [param] status    server api return error status, like 500
			 * [param] field
			 */
			cropUploadFail(status, field){
				console.log('-------- upload fail --------');
				console.log(status);
				console.log('field: ' + field);
			}
		}
	});
</script>

Example vue@1

<div id="app">
	<a class="btn" @click="toggleShow">set avatar</a>
	<my-upload field="img"
		:width="300"
		:height="300"
		url="/upload"
		:params="params"
		:headers="headers"
        lang-type="en"
		:value.sync="show"
		img-format="png"></my-upload>
	<img :src="imgDataUrl">
</div>

<script>
	import 'babel-polyfill'; // es6 shim
	import Vue from 'vue';
	import myUpload from 'vue-image-crop-upload/upload-1.vue';

	new Vue({
		el: '#app',
		data: {
			show: true,
			params: {
				token: '123456798',
				name: 'avatar'
			},
			headers: {
				smail: '*_~'
			},
			imgDataUrl: '' // the datebase64 url of created image
		},
		components: {
			'my-upload': myUpload
		},
		methods: {
			toggleShow() {
				this.show = !this.show;
			}
		},
		events: {
			/**
			 * crop success
			 *
			 * [param] imgDataUrl
			 * [param] field
			 */
			cropSuccess(imgDataUrl, field){
				console.log('-------- crop success --------');
				this.imgDataUrl = imgDataUrl;
			},
			/**
			 * upload success
			 *
			 * [param] jsonData   server api return data, already json encode
			 * [param] field
			 */
			cropUploadSuccess(jsonData, field){
				console.log('-------- upload success --------');
				console.log(jsonData);
				console.log('field: ' + field);
			},
			/**
			 * upload fail
			 *
			 * [param] status    server api return error status, like 500
			 * [param] field
			 */
			cropUploadFail(status, field){
				console.log('-------- upload fail --------');
				console.log(status);
				console.log('field: ' + field);
			}
		}
	});

</script>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].