Skip to content

Commit

Permalink
fix(SPA): 修复无法创建圈子的问题
Browse files Browse the repository at this point in the history
issue #542

(cherry picked from commit 2e73eb68cc3e0351cf5bdaac70f91194a0c10185)

# Conflicts:
#	resources/spa/src/components/form/FormAvatarItem.vue
  • Loading branch information
mutoe committed Jan 24, 2019
1 parent 9581748 commit 8965728
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions resources/spa/src/components/form/FormAvatarItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@

<ImageUploader
ref="uploader"
v-model="value"
type="storage"
:value="value"
:type="type"
@input="$emit('input', $event)"
@update:src="avatar = $event"
/>
</section>
Expand All @@ -24,18 +25,23 @@ export default {
name: 'FormAvatarItem',
components: { ImageUploader },
props: {
value: { type: null, default: null },
value: { type: null, default: () => ({}) },
label: { type: String, default: '上传头像' },
readonly: { type: Boolean, default: false },
/**
* 文件类型
*/
type: { type: String, default: 'storage', validator (type) { return ['blob', 'id', 'url', 'storage'].includes(type) } },
/**
* 头像形状 square: 方形 circle: 圆形
*/
shape: { type: String, default: 'circle' },
},
data () {
return {
avatar: null,
avatar: this.type === 'storage'
? this.$props.value.url
: this.$props.value,
}
},
methods: {
Expand Down

0 comments on commit 8965728

Please sign in to comment.