From 3398fef54015ccc8610bd2ef60fdc5dc6bbe0264 Mon Sep 17 00:00:00 2001 From: rubinhuang9239 Date: Sun, 9 Jun 2024 20:17:16 +0800 Subject: [PATCH] fix: prevent duplicate-declarations by check if wc is already exist in the evironment --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 3d420f2..18f5f30 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,4 +3,4 @@ import { WaterfallElement } from './waterfall' export * from './waterfall' export type { WaterfallProps } from './layout' -customElements.define('wc-waterfall', WaterfallElement) \ No newline at end of file +if (!customElements.get('wc-waterfall')) { customElements.define('wc-waterfall', WaterfallElement); } \ No newline at end of file