HeadImage.vue 639 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <template>
  2. <img :src="url"
  3. :style="{width: size+'px',height: size+'px',cursor: 'pointer'}" />
  4. </template>
  5. <script>
  6. export default {
  7. name: "headImage",
  8. data() {
  9. return {
  10. }
  11. },
  12. methods:{
  13. },
  14. props: {
  15. size: {
  16. type: Number,
  17. default: 50
  18. },
  19. url:{
  20. type: String
  21. }
  22. }
  23. }
  24. </script>
  25. <style scoped lang="scss">
  26. img {
  27. position: relative;
  28. overflow: hidden;
  29. border-radius: 5%;
  30. }
  31. img:before {
  32. content: '';
  33. display: block;
  34. width: 100%;
  35. height: 100%;
  36. background:url('../../assets/default_head.png') no-repeat 0 0;
  37. background-size: 100%;
  38. }
  39. </style>