mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 08:18:42 +00:00
Update the nuxt3 version. Co-authored-by: Jonathan Adeline <jonathan@baserow.io> Co-authored-by: Bram Wiepjes <bramw@protonmail.com> Co-authored-by: Cezary <cezary@baserow.io> Co-authored-by: Tsering Paljor <tsering@baserow.io> Co-authored-by: Przemyslaw Kukulski <przemyslaw+gh@baserow.io> Co-authored-by: Bram <bram2w@users.noreply.github.com>
20 lines
567 B
JavaScript
20 lines
567 B
JavaScript
import { inject, provide, computed, unref } from 'vue'
|
|
|
|
export function useApplicationContext(props) {
|
|
// Inject parent context (same behavior as the mixin)
|
|
const injectedApplicationContext = inject('applicationContext', {})
|
|
|
|
// Create the merged application context
|
|
const applicationContext = computed(() => ({
|
|
...unref(injectedApplicationContext),
|
|
...(unref(props.applicationContextAdditions) ?? {}),
|
|
}))
|
|
|
|
// Provide the merged context to descendants
|
|
provide('applicationContext', applicationContext)
|
|
|
|
return {
|
|
applicationContext,
|
|
}
|
|
}
|