<template>
	<div class="avatar-img" :class="{'radius': radius}" :style="{width: width + 'upx', height: width + 'upx', borderRadius: radius}">
        <img :style="{width: width + 'upx', height: width + 'upx', borderRadius: radius}" :src="imgUrl" alt="头像">
    </div>
</template>

<script>
import defaultImg from '@/static/images/user/attr-default.png'
export default {
	name: 'avatar-module',
	props: {
		width: {
			type: Number,
			default: 100
		},
		src: {
			type: String,
			default: ''
		},
		// 圆角数
		radius: {
			type: String,
			default: '50%'
		}
	},
	computed: {
		imgUrl() {
			return this.src || defaultImg
		}
	}
}
</script>

<style lang="scss" scoped>
</style>
