mirror of
https://github.com/unraid/api.git
synced 2026-02-18 05:58:28 -06:00
refactor: instantiation of web components
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
<script lang="ts" setup>
|
||||
const nuxtApp = useNuxtApp();
|
||||
const { registerEntry } = useCustomElements();
|
||||
onBeforeMount(() => {
|
||||
// @ts-expect-error - becuase customElements is not a type in nuxtApp and is not provided by the nuxt plugin
|
||||
nuxtApp.$customElements.registerEntry('UnraidComponents');
|
||||
registerEntry('UnraidComponents');
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -5,9 +5,10 @@ import type { SendPayloads } from '~/store/callback';
|
||||
import { serverState } from '~/_data/serverState';
|
||||
|
||||
const nuxtApp = useNuxtApp();
|
||||
|
||||
const { registerEntry } = useCustomElements();
|
||||
onBeforeMount(() => {
|
||||
// @ts-expect-error - customElements doesn't provide types
|
||||
nuxtApp.$customElements.registerEntry('UnraidComponents');
|
||||
registerEntry('UnraidComponents');
|
||||
});
|
||||
|
||||
const valueToMakeCallback = ref<SendPayloads | undefined>();
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<script lang="ts" setup>
|
||||
import { serverState } from '~/_data/serverState';
|
||||
|
||||
const nuxtApp = useNuxtApp();
|
||||
const { registerEntry } = useCustomElements();
|
||||
onBeforeMount(() => {
|
||||
// @ts-expect-error - customElements not providing types here
|
||||
nuxtApp.$customElements.registerEntry('UnraidComponents');
|
||||
registerEntry('UnraidComponents');
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user