zw-img.vue 497 B

1234567891011121314151617181920212223242526272829303132333435
  1. <template>
  2. <view class="images" :style="{backgroundImage: 'url(' + src + ')'}">
  3. </view>
  4. </template>
  5. <script>
  6. export default {
  7. name: "zw-img",
  8. props: {
  9. // :src="$getImgPath(item.icon)"
  10. src: {
  11. type: String,
  12. default: ''
  13. },
  14. mode: {
  15. type: String,
  16. default: 'aspectFit'
  17. }
  18. },
  19. data() {
  20. return {
  21. // <image class="images" :src="src" :mode="mode" />
  22. };
  23. }
  24. }
  25. </script>
  26. <style lang="scss" scoped>
  27. .images {
  28. width: 100%;
  29. height: 100%;
  30. }
  31. </style>