BeeAvatar.vue 786 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <tui-lazyload-img
  3. class="image-wrapper" :width="width ? width * 2 + 'rpx' : size * 2 + 'rpx'"
  4. :height="height ? height * 2 + 'rpx' : size * 2 + 'rpx'" :src="src" :radius="radius"
  5. :background-color="backgroundColor" mode="scaleToFill" :disconnect="true"
  6. @click="$emit('click')"
  7. ></tui-lazyload-img>
  8. </template>
  9. <script>
  10. export default {
  11. name: 'BeeAvatar',
  12. props: {
  13. src: {
  14. type: String,
  15. default: ''
  16. },
  17. size: {
  18. type: Number,
  19. default: 80
  20. },
  21. width: {
  22. type: Number
  23. },
  24. height: {
  25. type: Number
  26. },
  27. radius: {
  28. type: String,
  29. default: '50%'
  30. },
  31. backgroundColor: {
  32. type: String,
  33. default: '#fff'
  34. }
  35. }
  36. }
  37. </script>
  38. <style lang="less" scoped>
  39. .image-wrapper {
  40. flex-shrink: 0;
  41. }
  42. image {
  43. will-change: transform
  44. }
  45. </style>