liveh5-nuxt/app/components/x-image/index.vue
xingyy aad429be0a refactor(app): 移除 @nuxt/image 模块并调整相关组件
- 移除了 @nuxt/image 模块引用- 更新了 x-image 组件,使用原生 img 标签替代 nuxt-img
- 调整了 home 和 login 页面中的样式
- 更新了 realAuth 页面的路由和样式
2025-02-14 16:47:56 +08:00

34 lines
488 B
Vue

<script setup>
import { showImagePreview } from 'vant';
const props = defineProps({
src: {
type: String,
default: ''
},
preview: {
type: Boolean,
default: true
},
})
const showImage = () => {
if (props.preview) {
showImagePreview([props.src]);
}
}
</script>
<template>
<img
loading="lazy"
v-bind="{ ...$props, ...$attrs }"
style="object-fit: cover"
@click="showImage"
:src="src"
/>
</template>
<style scoped>
</style>