From d73c04afc771fc0ff105e12d5d99351b605345f4 Mon Sep 17 00:00:00 2001 From: James Wragg Date: Mon, 14 Nov 2022 13:28:32 +0000 Subject: [PATCH] fix(useStyleTag): allow use of existing node --- packages/core/useStyleTag/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/core/useStyleTag/index.ts b/packages/core/useStyleTag/index.ts index d89e11203c0..2ebb4d6868f 100644 --- a/packages/core/useStyleTag/index.ts +++ b/packages/core/useStyleTag/index.ts @@ -76,7 +76,9 @@ export function useStyleTag( el.id = id if (options.media) el.media = options.media - document.head.appendChild(el) + + if(!el.isConnected) + document.head.appendChild(el) if (isLoaded.value) return