Skip to content

Commit 81bb981

Browse files
committed
(chore) check if element already registered
1 parent 13a3a36 commit 81bb981

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/lib/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ import ChatWindow from './ChatWindow'
33

44
export const VueAdvancedChat = defineCustomElement(ChatWindow)
55

6+
const PACKAGE_NAME = 'vue-advanced-chat'
7+
68
export function register() {
7-
customElements.define('vue-advanced-chat', VueAdvancedChat)
9+
if (!customElements.get(PACKAGE_NAME)) {
10+
customElements.define(PACKAGE_NAME, VueAdvancedChat)
11+
}
812
}

0 commit comments

Comments
 (0)