app-cart-image.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <template>
  2. <image
  3. :style="{width: imageWidth,height: imageHeight}"
  4. :src="src" v-show="is_loading" @load="imgLoad" :class="sign !== 'gift' ? getTheme + '-m-back ' + getTheme : theme + '-background'"
  5. ></image>
  6. </template>
  7. <script>
  8. import {mapGetters} from "vuex";
  9. export default {
  10. name: "app-cart-image",
  11. data() {
  12. return {
  13. is_loading: false,
  14. }
  15. },
  16. props: {
  17. imageWidth: {
  18. type: String,
  19. default: '36rpx'
  20. },
  21. imageHeight: {
  22. type: String,
  23. default: '36rpx'
  24. },
  25. src: {
  26. type: String,
  27. default: '/static/image/icon/goods-cart.png'
  28. },
  29. sign: String,
  30. theme: String
  31. },
  32. computed: {
  33. ...mapGetters('mallConfig', {
  34. getTheme: 'getTheme',
  35. })
  36. },
  37. methods: {
  38. imgLoad() {
  39. this.is_loading = true;
  40. }
  41. }
  42. }
  43. </script>