Skip to content

Commit 429172b

Browse files
committed
fix: tour center
1 parent e5787c2 commit 429172b

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

components/vc-tour/Tour.tsx

+16-2
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,24 @@ const Tour = defineComponent({
209209
rootClassName={rootClassName}
210210
/>
211211
<Trigger
212-
builtinPlacements={getPlacements(arrowPointAtCenter.value)}
213212
{...restProps}
213+
builtinPlacements={
214+
!curStep.value.target
215+
? undefined
216+
: restProps.builtinPlacements ?? getPlacements(arrowPointAtCenter.value)
217+
}
214218
ref={triggerRef}
215-
popupStyle={curStep.value.style}
219+
popupStyle={
220+
!curStep.value.target
221+
? {
222+
...curStep.value.style,
223+
position: 'fixed',
224+
left: CENTER_PLACEHOLDER.left,
225+
top: CENTER_PLACEHOLDER.top,
226+
transform: 'translate(-50%, -50%)',
227+
}
228+
: curStep.value.style
229+
}
216230
popupPlacement={mergedPlacement.value}
217231
popupVisible={mergedOpen.value}
218232
popupClassName={classNames(rootClassName, curStep.value.className)}

0 commit comments

Comments
 (0)