liveh5-nuxt/app/components/x-image/index.vue
xingyy d3cb4d55b4 refactor(components): 优化多个组件的结构和功能
- 为 x-button 和 x-popup 组件添加注释说明
- 在 x-image 组件中添加 lazy 加载属性
- 优化 profile 页面的我的拍品列表展示
- 更新 tang
2025-01-22 16:23:48 +08:00

29 lines
479 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 }"
@click="showImage"
>
</template>