mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-04-06 03:57:53 +08:00
* perf[navbar]: set langSelect to component && refine errorLog component
* feat[login]:add 18n to login form
* fix[pagination]: fixed when selected page-sizes
* perf[i18n]:dashboard document svg permission
* perf[charts]: perf effect
* perf[i18n]:excel && zip
* perf[i18n]: table && errorLog && theme
* perf[i18n]: components
* perf[i18n]: direct use $t
* perf[i18n]: complex-table
* update README.md
* update README.md 📘
* perf[i18n]: refine code comments
53 lines
1.4 KiB
Vue
53 lines
1.4 KiB
Vue
<template>
|
|
<div class="components-container">
|
|
<code>This is based on
|
|
<a class="link-type" href="//github.com/dai-siki/vue-image-crop-upload"> vue-image-crop-upload</a>.
|
|
{{$t('components.imageUploadTips')}}
|
|
</code>
|
|
|
|
<pan-thumb :image="image"></pan-thumb>
|
|
|
|
<el-button type="primary" icon="upload" style="position: absolute;bottom: 15px;margin-left: 40px;" @click="imagecropperShow=true">Change avatar
|
|
</el-button>
|
|
|
|
<image-cropper :width="300" :height="300" url="https://httpbin.org/post" @close='close' @crop-upload-success="cropSuccess" langType="en"
|
|
:key="imagecropperKey" v-show="imagecropperShow"></image-cropper>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import ImageCropper from '@/components/ImageCropper'
|
|
import PanThumb from '@/components/PanThumb'
|
|
|
|
export default {
|
|
name: 'avatarUpload-demo',
|
|
components: { ImageCropper, PanThumb },
|
|
data() {
|
|
return {
|
|
imagecropperShow: false,
|
|
imagecropperKey: 0,
|
|
image: 'https://wpimg.wallstcn.com/577965b9-bb9e-4e02-9f0c-095b41417191'
|
|
}
|
|
},
|
|
methods: {
|
|
cropSuccess(resData) {
|
|
this.imagecropperShow = false
|
|
this.imagecropperKey = this.imagecropperKey + 1
|
|
this.image = resData.files.avatar
|
|
},
|
|
close() {
|
|
this.imagecropperShow = false
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.avatar{
|
|
width: 200px;
|
|
height: 200px;
|
|
border-radius: 50%;
|
|
}
|
|
</style>
|
|
|