fix: prevent SSR crash

This commit is contained in:
Julian Hundeloh
2021-12-16 11:39:58 +01:00
committed by GitHub
parent dcff577724
commit fe2d99d36d
+1 -1
View File
@@ -81,7 +81,7 @@ const TippyComponent = defineComponent({
let target: any = elem
if (props.to) {
if (props.to instanceof Element) {
if (typeof Element !== 'undefined' && props.to instanceof Element) {
target = () => props.to
} else if (typeof props.to === 'string' || props.to instanceof String) {
target = () => document.querySelector(props.to)