<template>
  <div :class="[avatar, size]">
    <img
      v-if="src"
      :src="src"
      :style="{ width: 'inherit', height: 'inherit' }"
    >
    <img v-else>
  </div>
</template>

<script>
export default {
  name: 'CuAvatar',
  props: {
    src: {
      type: String,
      default: ''
    },
    size: {
      type: String,
      default: ''
    }
  },
  data () {
    return {
      avatar: 'avatar'
    }
  }
}
</script>

<style lang="scss" scoped>
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 100px;
  background: #eee;
  overflow: hidden;

  &.small {
    width: 24px;
    height: 24px;
  }

  &.big {
    width: 70px;
    height: 70px;
  }
}
</style>
