Commit 0a9171d5 authored by 王玉鑫's avatar 王玉鑫

fix: 详情页vr跳转修正

parent 913a52ac
<!-- 图片展示,方便修改占位图、错误图 -->
<template>
<ElImage :src="src">
<ElImage :src="src" @click="handleClick">
<template #placeholder>
<img class="h-full w-full" :src="currentdefault" />
<img class="h-full w-full" :src="currentdefault" @click.stop="handleClick" />
</template>
<template #error>
<img class="h-full w-full" :src="currentdefault" @click.stop="handleClick" />
</template>
<template #error><img class="h-full w-full" :src="currentdefault" /></template>
</ElImage>
</template>
......@@ -30,6 +32,8 @@ const props = withDefaults(
},
);
const emit = defineEmits(['click']);
const currentdefault = computed(() => {
const config: Record<DetailType, string> = {
[DetailType.carrier]: defaultCarrierPic,
......@@ -40,4 +44,8 @@ const currentdefault = computed(() => {
};
return props.type ? config[props.type] : defaultPicIcon;
});
const handleClick = () => {
emit('click');
};
</script>
......@@ -19,6 +19,7 @@
<div
v-if="image?.href"
class="vr-icon absolute left-1/2 top-1/2 z-20 -translate-x-1/2 -translate-y-1/2 cursor-pointer"
@click="handleClick(image?.href)"
></div>
</SwiperSlide>
</Swiper>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment