forked from vueComponent/ant-design-vue
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpreview-group-visible.vue
49 lines (43 loc) · 1.1 KB
/
preview-group-visible.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<docs>
---
order: 6
title:
zh-CN: 相册模式
en-US: Preview from one image
---
## zh-CN
从一张图片点开相册。
## en-US
Preview a collection from one image.
</docs>
<template>
<a-image
:preview="{ visible: false }"
:width="200"
src="https://gw.alipayobjects.com/zos/antfincdn/LlvErxo8H9/photo-1503185912284-5271ff81b9a8.webp"
@click="visible = true"
/>
<div style="display: none">
<a-image-preview-group :preview="{ visible, onVisibleChange: vis => (visible = vis) }">
<a-image
src="https://gw.alipayobjects.com/zos/antfincdn/LlvErxo8H9/photo-1503185912284-5271ff81b9a8.webp"
/>
<a-image
src="https://gw.alipayobjects.com/zos/antfincdn/cV16ZqzMjW/photo-1473091540282-9b846e7965e3.webp"
/>
<a-image
src="https://gw.alipayobjects.com/zos/antfincdn/x43I27A55%26/photo-1438109491414-7198515b166b.webp"
/>
</a-image-preview-group>
</div>
</template>
<script lang="ts">
import { defineComponent, ref } from 'vue';
export default defineComponent({
setup() {
return {
visible: ref(false),
};
},
});
</script>