import { createApp, ref, App as VueApp } from "vue"; import App from "@/sticky/app/App.vue"; import { createPinia } from "pinia"; const rootElements: NodeListOf = document.querySelectorAll(".ccb-sticky-calc"); rootElements.forEach((rootElement) => { const rootRef = ref | null>(null); const app: VueApp = createApp(App).provide( "calc_id", rootElement.getAttribute("data-calc-id"), ); rootRef.value = app; app.use(createPinia()); app.mount(rootElement); });