Blame view

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