Commit 33d8dbef45d3e98dd294311f702ce810ad3a165e
1 parent
30f16044
v3.5.0 update ruoyi-ui/src/views/system/user/profile/userAvatar.vue. 修改头像,截图支持取消
Showing
1 changed file
with
5 additions
and
1 deletions
yudao-ui-admin/src/views/system/user/profile/userAvatar.vue
| 1 | <template> | 1 | <template> |
| 2 | <div> | 2 | <div> |
| 3 | <div class="user-info-head" @click="editCropper()"><img v-bind:src="options.img" title="点击上传头像" class="img-circle img-lg" /></div> | 3 | <div class="user-info-head" @click="editCropper()"><img v-bind:src="options.img" title="点击上传头像" class="img-circle img-lg" /></div> |
| 4 | - <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body @opened="modalOpened"> | 4 | + <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body @opened="modalOpened" @close="closeDialog()"> |
| 5 | <el-row> | 5 | <el-row> |
| 6 | <el-col :xs="24" :md="12" :style="{height: '350px'}"> | 6 | <el-col :xs="24" :md="12" :style="{height: '350px'}"> |
| 7 | <vue-cropper | 7 | <vue-cropper |
| @@ -136,6 +136,10 @@ export default { | @@ -136,6 +136,10 @@ export default { | ||
| 136 | // 实时预览 | 136 | // 实时预览 |
| 137 | realTime(data) { | 137 | realTime(data) { |
| 138 | this.previews = data; | 138 | this.previews = data; |
| 139 | + }, | ||
| 140 | + // 取消截图,关闭对话框 | ||
| 141 | + closeDialog() { | ||
| 142 | + this.options.img = store.getters.avatar | ||
| 139 | } | 143 | } |
| 140 | } | 144 | } |
| 141 | }; | 145 | }; |