File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 694694 // 上传成功
695695 function (resData ) {
696696 that .loading = 2 ;
697- that .$emit (' crop-upload-success' , url );
697+ that .$emit (' crop-upload-success' , resData );
698698 },
699699 // 上传失败
700700 function (sts ) {
Original file line number Diff line number Diff line change 44 由于我在使用时它只有vue@1版本,而且有些业务的需求耦合到七牛等等原因吧,自己改造了一下,如果大家要使用的话,优先还是使用官方component
55 </code >
66
7- <PanThumb image =' https://wpimg.wallstcn.com/577965b9-bb9e-4e02-9f0c-095b41417191 ' >
7+ <PanThumb : image =' image ' >
88 </PanThumb >
99 <el-button type =" primary" icon =" upload" style =" position : absolute ;bottom : 15px ;margin-left : 40px ;" @click =" imagecropperShow=true" >修改头像
1010 </el-button >
1111
12- <ImageCropper :width =" 300" :height =" 300" url =" https://httpbin.org/post" @crop-upload-success =" cropSuccess" :key =" imagecropperKey"
13- v-show =" imagecropperShow" />
12+ <ImageCropper :width =" 300" :height =" 300" url =" https://httpbin.org/post" @crop-upload-success =" cropSuccess" :key =" imagecropperKey" v-show =" imagecropperShow" />
1413 </div >
1514</template >
1615<script >
2120 data () {
2221 return {
2322 imagecropperShow: false ,
24- imagecropperKey: 0
23+ imagecropperKey: 0 ,
24+ image: ' https://wpimg.wallstcn.com/577965b9-bb9e-4e02-9f0c-095b41417191'
2525 }
2626 },
2727 methods: {
28- cropSuccess () {
28+ cropSuccess (resData ) {
2929 this .imagecropperShow = false ;
3030 this .imagecropperKey = this .imagecropperKey + 1 ;
31+ this .image = resData .files .avatar ;
3132 }
3233 }
3334 };
You can’t perform that action at this time.
0 commit comments