-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
Copy pathcomponent-preview-group-debug.demo.vue
76 lines (70 loc) · 2.1 KB
/
component-preview-group-debug.demo.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<markdown>
# debug preview group
</markdown>
<script lang="ts" setup>
import { ref } from 'vue'
const currentIndex = ref(1)
const imageGroupRef = ref()
function onClick() {
imageGroupRef.value?.toggleShow()
}
const currentIndex2 = ref(0)
const imageGroupRef2 = ref()
function onClick2() {
imageGroupRef2.value?.toggleShow()
}
</script>
<template>
<n-space vertical>
<p>src-list</p>
<n-button type="primary" @click="onClick">
Click me to preview multiple image
</n-button>
<n-image-group
ref="imageGroupRef"
v-model:current="currentIndex"
:src-list="[
'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg',
'https://gw.alipayobjects.com/zos/antfincdn/aPkFc8Sj7n/method-draw-image.svg',
'https://picsum.photos/id/1/100/100',
'https://picsum.photos/id/2/100/100',
'https://picsum.photos/id/3/100/100',
'https://picsum.photos/id/4/100/100',
'https://picsum.photos/id/5/100/100',
'https://picsum.photos/id/7/100/100',
'https://picsum.photos/id/8/100/100',
'https://picsum.photos/id/9/100/100',
'https://picsum.photos/id/10/100/100',
]"
>
<n-space>
<n-image
width="100"
src="https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg"
/>
<n-image
width="100"
src="https://gw.alipayobjects.com/zos/antfincdn/aPkFc8Sj7n/method-draw-image.svg"
/>
</n-space>
</n-image-group>
<pre>currentIndex: {{ currentIndex }}</pre>
<p>n-image</p>
<n-button type="primary" @click="onClick2">
Click me to preview multiple image
</n-button>
<n-image-group ref="imageGroupRef2" v-model:current="currentIndex2">
<n-space>
<n-image
width="100"
src="https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg"
/>
<n-image
width="100"
src="https://gw.alipayobjects.com/zos/antfincdn/aPkFc8Sj7n/method-draw-image.svg"
/>
</n-space>
</n-image-group>
<pre>currentIndex: {{ currentIndex2 }}</pre>
</n-space>
</template>