File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div class =" user-info-head" @click =" open()" >
3
3
<img v-if =" sourceValue" :src =" sourceValue" alt =" avatar" class =" img-circle img-lg" />
4
+ <img v-if =" !sourceValue" :src =" avatar" alt =" avatar" class =" img-circle img-lg" />
4
5
<el-button v-if =" showBtn" :class =" `${prefixCls}-upload-btn`" @click =" open()" >
5
6
{{ btnText ? btnText : t('cropper.selectImage') }}
6
7
</el-button >
@@ -17,6 +18,7 @@ import { useDesign } from '@/hooks/web/useDesign'
17
18
import { propTypes } from ' @/utils/propTypes'
18
19
import { useI18n } from ' vue-i18n'
19
20
import CopperModal from ' ./CopperModal.vue'
21
+ import avatar from ' @/assets/imgs/avatar.jpg'
20
22
21
23
defineOptions ({ name: ' CropperAvatar' })
22
24
Original file line number Diff line number Diff line change 4
4
ref =" cropperRef"
5
5
:btnProps =" { preIcon: 'ant-design:cloud-upload-outlined' }"
6
6
:showBtn =" false"
7
- :value =" avatar "
7
+ :value =" img "
8
8
width =" 120px"
9
9
@change =" handelUpload"
10
10
/>
13
13
<script lang="ts" setup>
14
14
import { propTypes } from ' @/utils/propTypes'
15
15
import { uploadAvatar } from ' @/api/system/user/profile'
16
+ import { CropperAvatar } from ' @/components/Cropper'
16
17
17
18
defineOptions ({ name: ' UserAvatar' })
18
19
19
- const props = defineProps ({
20
+ defineProps ({
20
21
img: propTypes .string .def (' ' )
21
22
})
22
- const avatar = computed (() => {
23
- return props .img
24
- })
25
23
26
24
const cropperRef = ref ()
27
25
const handelUpload = async ({ data }) => {
You can’t perform that action at this time.
0 commit comments