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 11<template >
22 <div class =" user-info-head" @click =" open()" >
33 <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" />
45 <el-button v-if =" showBtn" :class =" `${prefixCls}-upload-btn`" @click =" open()" >
56 {{ btnText ? btnText : t('cropper.selectImage') }}
67 </el-button >
@@ -17,6 +18,7 @@ import { useDesign } from '@/hooks/web/useDesign'
1718import { propTypes } from ' @/utils/propTypes'
1819import { useI18n } from ' vue-i18n'
1920import CopperModal from ' ./CopperModal.vue'
21+ import avatar from ' @/assets/imgs/avatar.jpg'
2022
2123defineOptions ({ name: ' CropperAvatar' })
2224
Original file line number Diff line number Diff line change 44 ref =" cropperRef"
55 :btnProps =" { preIcon: 'ant-design:cloud-upload-outlined' }"
66 :showBtn =" false"
7- :value =" avatar "
7+ :value =" img "
88 width =" 120px"
99 @change =" handelUpload"
1010 />
1313<script lang="ts" setup>
1414import { propTypes } from ' @/utils/propTypes'
1515import { uploadAvatar } from ' @/api/system/user/profile'
16+ import { CropperAvatar } from ' @/components/Cropper'
1617
1718defineOptions ({ name: ' UserAvatar' })
1819
19- const props = defineProps ({
20+ defineProps ({
2021 img: propTypes .string .def (' ' )
2122})
22- const avatar = computed (() => {
23- return props .img
24- })
2523
2624const cropperRef = ref ()
2725const handelUpload = async ({ data }) => {
You can’t perform that action at this time.
0 commit comments