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.
		
		
		
		
		
			
		
			
				
					
					
						
							61 lines
						
					
					
						
							1.2 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							61 lines
						
					
					
						
							1.2 KiB
						
					
					
				
								import { VantComponent } from '../common/component';
							 | 
						|
								import { button } from '../mixins/button';
							 | 
						|
								import { openType } from '../mixins/open-type';
							 | 
						|
								VantComponent({
							 | 
						|
								  mixins: [button, openType],
							 | 
						|
								  classes: ['custom-class', 'loading-class', 'error-class', 'image-class'],
							 | 
						|
								  props: {
							 | 
						|
								    src: {
							 | 
						|
								      type: String,
							 | 
						|
								      observer() {
							 | 
						|
								        this.setData({
							 | 
						|
								          error: false,
							 | 
						|
								          loading: true,
							 | 
						|
								        });
							 | 
						|
								      },
							 | 
						|
								    },
							 | 
						|
								    round: Boolean,
							 | 
						|
								    width: null,
							 | 
						|
								    height: null,
							 | 
						|
								    radius: null,
							 | 
						|
								    lazyLoad: Boolean,
							 | 
						|
								    useErrorSlot: Boolean,
							 | 
						|
								    useLoadingSlot: Boolean,
							 | 
						|
								    showMenuByLongpress: Boolean,
							 | 
						|
								    fit: {
							 | 
						|
								      type: String,
							 | 
						|
								      value: 'fill',
							 | 
						|
								    },
							 | 
						|
								    showError: {
							 | 
						|
								      type: Boolean,
							 | 
						|
								      value: true,
							 | 
						|
								    },
							 | 
						|
								    showLoading: {
							 | 
						|
								      type: Boolean,
							 | 
						|
								      value: true,
							 | 
						|
								    },
							 | 
						|
								  },
							 | 
						|
								  data: {
							 | 
						|
								    error: false,
							 | 
						|
								    loading: true,
							 | 
						|
								    viewStyle: '',
							 | 
						|
								  },
							 | 
						|
								  methods: {
							 | 
						|
								    onLoad(event) {
							 | 
						|
								      this.setData({
							 | 
						|
								        loading: false,
							 | 
						|
								      });
							 | 
						|
								      this.$emit('load', event.detail);
							 | 
						|
								    },
							 | 
						|
								    onError(event) {
							 | 
						|
								      this.setData({
							 | 
						|
								        loading: false,
							 | 
						|
								        error: true,
							 | 
						|
								      });
							 | 
						|
								      this.$emit('error', event.detail);
							 | 
						|
								    },
							 | 
						|
								    onClick(event) {
							 | 
						|
								      this.$emit('click', event.detail);
							 | 
						|
								    },
							 | 
						|
								  },
							 | 
						|
								});
							 |