Skip to content

Commit

Permalink
fix(baseinfo): 修复基础资料上传头像不显示bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Hacker233 committed Mar 7, 2023
1 parent 37fcdd1 commit 61a9c65
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ declare module '@vue/runtime-core' {
ElButton: typeof import('element-plus/es')['ElButton'];
ElCarousel: typeof import('element-plus/es')['ElCarousel'];
ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem'];
ElCollapse: typeof import('element-plus/es')['ElCollapse'];
ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem'];
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'];
ElDatePicker: typeof import('element-plus/es')['ElDatePicker'];
ElDialog: typeof import('element-plus/es')['ElDialog'];
Expand Down
5 changes: 4 additions & 1 deletion src/material/BaseInfo/BaseInfo4/BaseInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
</template>
<template v-else>
<div v-show="isShow.avatar" class="avatar-shape-box">
<component :is="avatarComponents[modelData.avatarShape]"></component>
<component
:is="avatarComponents[modelData.avatarShape]"
:model-data="modelData"
></component>
</div>
</template>
</div>
Expand Down
5 changes: 4 additions & 1 deletion src/material/BaseInfo/BaseInfo5/BaseInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
</template>
<template v-else>
<div v-show="isShow.avatar" class="avatar-shape-box">
<component :is="avatarComponents[modelData.avatarShape]"></component>
<component
:is="avatarComponents[modelData.avatarShape]"
:model-data="modelData"
></component>
</div>
</template>
</div>
Expand Down
5 changes: 4 additions & 1 deletion src/material/BaseInfo/BaseInfo6/BaseInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
</template>
<template v-else>
<div v-show="isShow.avatar" class="avatar-shape-box">
<component :is="avatarComponents[modelData.avatarShape]"></component>
<component
:is="avatarComponents[modelData.avatarShape]"
:model-data="modelData"
></component>
</div>
</template>
<div class="right">
Expand Down
5 changes: 4 additions & 1 deletion src/material/BaseInfo/BaseInfo7/BaseInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
</template>
<template v-else>
<div v-show="isShow.avatar" class="avatar-shape-box">
<component :is="avatarComponents[modelData.avatarShape]"></component>
<component
:is="avatarComponents[modelData.avatarShape]"
:model-data="modelData"
></component>
</div>
</template>
<div class="right">
Expand Down
2 changes: 1 addition & 1 deletion src/material/Common/BaseInfo/components/avatar/avatar1.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</template>
<template v-else>
<div v-show="isShow.avatar" class="avatar-shape-box">
<component :is="avatarComponents[modelData.avatarShape]"></component>
<component :is="avatarComponents[modelData.avatarShape]" :model-data="modelData"></component>
</div>
</template>
</template>
Expand Down
12 changes: 11 additions & 1 deletion src/options/BaseInfoOptions_1.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
<el-form label-width="100px" label-position="left">
<!-- 头像形状选择 -->
<el-form-item label="头像形状选择:">
<el-input v-model="modelItem.data.name" type="text" maxlength="15" show-word-limit />
<avatar-popover-shape-vue
:model-item="modelItem"
@change-shape="handleChangeShape"
></avatar-popover-shape-vue>
</el-form-item>
<!-- 公共样式属性 -->
<common-options></common-options>
Expand Down Expand Up @@ -68,6 +71,7 @@
import useDesignSelectModelItem from '@/hooks/material/useDesignSelectModelItem';
import CONFIG from '@/config';
import appStore from '@/store';
import AvatarPopoverShapeVue from '@/components/AvatarPopoverShape/AvatarPopoverShape.vue';
defineOptions({ name: 'BASE_INFO_OPTIONS' });
// 选中的模块
const { modelItem } = useDesignSelectModelItem();
Expand Down Expand Up @@ -97,6 +101,12 @@
}
return true;
};

// 改变头像形状
const handleChangeShape = (value: string | number) => {
modelItem.data.avatarShape = value;
console.log('切换头像后的数据', modelItem.data);
};
</script>
<style lang="scss">
.avatar-uploader .el-upload {
Expand Down

1 comment on commit 61a9c65

@vercel
Copy link

@vercel vercel bot commented on 61a9c65 Mar 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

resume-design – ./

resume-design-kappa.vercel.app

Please sign in to comment.