u--image.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <uvImage
  3. :src="src"
  4. :mode="mode"
  5. :width="width"
  6. :height="height"
  7. :shape="shape"
  8. :radius="radius"
  9. :lazyLoad="lazyLoad"
  10. :showMenuByLongpress="showMenuByLongpress"
  11. :loadingIcon="loadingIcon"
  12. :errorIcon="errorIcon"
  13. :showLoading="showLoading"
  14. :showError="showError"
  15. :fade="fade"
  16. :webp="webp"
  17. :duration="duration"
  18. :bgColor="bgColor"
  19. :customStyle="customStyle"
  20. @click="$emit('click')"
  21. @error="$emit('error')"
  22. @load="$emit('load')"
  23. >
  24. <template v-slot:loading>
  25. <slot name="loading"></slot>
  26. </template>
  27. <template v-slot:error>
  28. <slot name="error"></slot>
  29. </template>
  30. </uvImage>
  31. </template>
  32. <script>
  33. /**
  34. * 此组件存在的理由是,在nvue下,u-image被uni-app官方占用了,u-image在nvue中相当于image组件
  35. * 所以在nvue下,取名为u--image,内部其实还是u-iamge.vue,只不过做一层中转
  36. */
  37. import uvImage from '../u-image/u-image.vue';
  38. import props from '../u-image/props.js';
  39. import mpMixin from '../../libs/mixin/mpMixin.js';
  40. import mixin from '../../libs/mixin/mixin.js';
  41. export default {
  42. name: 'u--image',
  43. mixins: [mpMixin, props, mixin],
  44. components: {
  45. uvImage
  46. },
  47. emits: ['click', 'error', 'load']
  48. }
  49. </script>