From 477d184fc57cfd7513e5323dd71d070e64c1acf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BC=9A=E5=81=9A=E9=A5=AD=E7=9A=84=E4=BA=8C=E5=93=88?= Date: Sat, 5 Apr 2025 22:45:33 +0800 Subject: [PATCH] Update WidgetLayout.astro (#333) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 防止重复注册报错 --- src/components/widget/WidgetLayout.astro | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/widget/WidgetLayout.astro b/src/components/widget/WidgetLayout.astro index dcbc7602..3adb0150 100644 --- a/src/components/widget/WidgetLayout.astro +++ b/src/components/widget/WidgetLayout.astro @@ -54,5 +54,7 @@ const className = Astro.props.class } } - customElements.define('widget-layout', WidgetLayout); - \ No newline at end of file + if (!customElements.get("widget-layout")) { + customElements.define("widget-layout", WidgetLayout); + } +