PureImage.vue 665B

123456789101112131415161718192021222324252627282930313233343536
  1. <template>
  2. <div class="pure-image" :style="custStyle" @click="$emit('click')">
  3. <div />
  4. </div>
  5. </template>
  6. <script>
  7. // export default {
  8. // name: 'PureImage',
  9. // props: {
  10. // bgColor: {
  11. // type: String,
  12. // default: '#f0f0f0'
  13. // },
  14. // bgImage: String
  15. // },
  16. // computed: {
  17. // custStyle() {
  18. // return {
  19. // backgroundColor: this.bgColor,
  20. // backgroundImage: `url('${this.bgImage}')`
  21. // }
  22. // }
  23. // }
  24. // }
  25. </script>
  26. <style lang="scss" scoped>
  27. .pure-image {
  28. background-position: center center;
  29. background-size: cover;
  30. background-repeat: no-repeat;
  31. width: 100%;
  32. height: 100%;
  33. }
  34. </style>