<template>
	<view>
		<image v-if="isIcon" style="border-radius: 60rpx;" :class="[mymode=='widthFix'?'imageW':'imagev']"  :src="showdefault==1?'/static/logo.png':baseUrl+comUrl" :mode="mymode" @error="imageError" @click="myimageclick"></image>
		<image v-if="!isIcon" :class="[mymode=='widthFix'?'imageW':'imagev']"  :src="showdefault==1?'/static/logo.png':baseUrl+comUrl" :mode="mymode" @error="imageError" @click="myimageclick"></image>
	</view>
</template>


:class="[isActive==index?'active':'otherActiveClass']"

<script>
	export default {
		name:"myImage",
		props:{
			mysrc: '',
			mymode:'',
			isIcon:false
		},
		data() {
			return {
				defaultImage:'/static/logo.png',
				baseUrl:'https://backend.cityexpress168.com.vn/prod-api',
				showdefault:0,
				comUrl:this.mysrc
			};
		},
		watch: {
			mysrc(val){
				this.showdefault=0;
				this.comUrl = this.mysrc
				console.log(this.comUrl);
			}
		},
		methods:{
			imageError(){
				//this.comUrl = this.defaultImage;//morentup
				this.showdefault=1;
			},
			myimageclick(comUrl){
				this.$emit('Emyimageclick',comUrl);
			},
		},
	}
</script>

<style>
	.imageW{
		margin: 0rpx;
		width:100%;
	}
	.imageH{
		margin: 0rpx;
		height:100%;
	}
	.imagev{
		width:100%;
		height:100%;
	}
</style>
