You can define global layout props and pass them to its slot.This is example of default slot for PageLayout component:
Copy
// PageLayout main slot<slot :user="user" :showAuthModal="authRef?.open" :isAuth="authRef?.auth" :checkAuth="authRef?.check" />// Render content as PageLayout slot and use its props<PageLayout #default="{ user, showAuthModal, isAuth, checkAuth }"> Content goes here... User name: {{ user?.name }} User is authenticated {{ isAuth }}</PageLayout>
You can also pass global properties from parent to children using provide and inject.
Copy
// Parent componentimport { provide } from "vue";provide("foo", "bar");
Copy
// Child componentimport { inject } from "vue";// Will be equal to "foo" or "" if not providedconst foo: string = inject("foo", "");