You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.2 KiB

4 months ago
  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';
  40. import { mixin } from '../../libs/mixin/mixin';
  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>