@@ -21,7 +21,7 @@ export interface ProseImgProps {
21
21
</script >
22
22
23
23
<script setup lang="ts">
24
- import { ref , computed } from ' vue'
24
+ import { ref , computed , useId } from ' vue'
25
25
import { withTrailingSlash , withLeadingSlash , joinURL } from ' ufo'
26
26
import { DialogRoot , DialogPortal , DialogTrigger } from ' reka-ui'
27
27
import { AnimatePresence , Motion } from ' motion-v'
@@ -57,6 +57,8 @@ const refinedSrc = computed(() => {
57
57
return props .src
58
58
})
59
59
60
+ const layoutId = computed (() => ` ${refinedSrc .value }::${useId ()} ` )
61
+
60
62
if (props .zoom ) {
61
63
useEventListener (window , ' scroll' , () => {
62
64
open .value = false
@@ -79,7 +81,7 @@ if (props.zoom) {
79
81
80
82
<DialogRoot v-if =" zoom" v-slot =" { close }" v-model:open =" open" :modal =" false" >
81
83
<DialogTrigger as-child >
82
- <Motion :layout-id =" refinedSrc " as-child :transition =" { type: 'spring', bounce: 0.2, duration: 0.4 }" >
84
+ <Motion :layout-id =" layoutId " as-child :transition =" { type: 'spring', bounce: 0.2, duration: 0.4 }" >
83
85
<ReuseImageTemplate />
84
86
</Motion >
85
87
</DialogTrigger >
@@ -89,7 +91,7 @@ if (props.zoom) {
89
91
<Motion v-if =" open" :initial =" { opacity: 0 }" :animate =" { opacity: 1 }" :exit =" { opacity: 0 }" :class =" ui.overlay({ class: [props.ui?.overlay] })" />
90
92
91
93
<div v-if =" open" :class =" ui.content({ class: [props.ui?.content] })" @click =" close" >
92
- <Motion as-child :layout-id =" refinedSrc " :transition =" { type: 'spring', bounce: 0.2, duration: 0.4 }" >
94
+ <Motion as-child :layout-id =" layoutId " :transition =" { type: 'spring', bounce: 0.2, duration: 0.4 }" >
93
95
<ReuseImageTemplate />
94
96
</Motion >
95
97
</div >
0 commit comments