Browse Source

Update index.vue

main
Edward zZhang 3 years ago
committed by GitHub
parent
commit
55dac2641d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      web/src/components/customPic/index.vue

6
web/src/components/customPic/index.vue

@ -2,11 +2,11 @@
<span class="headerAvatar"> <span class="headerAvatar">
<template v-if="picType === 'avatar'"> <template v-if="picType === 'avatar'">
<el-avatar v-if="userInfo.headerImg" :size="30" :src="avatar" /> <el-avatar v-if="userInfo.headerImg" :size="30" :src="avatar" />
<el-avatar v-else :size="30" :src="require('@/assets/noBody.png')" />
<el-avatar v-else :size="30" :src="noAvatar" />
</template> </template>
<template v-if="picType === 'img'"> <template v-if="picType === 'img'">
<img v-if="userInfo.headerImg" :src="avatar" class="avatar"> <img v-if="userInfo.headerImg" :src="avatar" class="avatar">
<img v-else :src="require('@/assets/noBody.png')" class="avatar">
<img v-else :src="noAvatar" class="avatar">
</template> </template>
<template v-if="picType === 'file'"> <template v-if="picType === 'file'">
<img :src="file" class="file"> <img :src="file" class="file">
@ -15,6 +15,7 @@
</template> </template>
<script> <script>
import noAvatar from '@/assets/noBody.png'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
const path = import.meta.env.VITE_BASE_API const path = import.meta.env.VITE_BASE_API
export default { export default {
@ -33,6 +34,7 @@ export default {
}, },
data() { data() {
return { return {
noAvatar: noAvatar,
path: path + '/' path: path + '/'
} }
}, },

Loading…
Cancel
Save