mirror of
https://github.com/zammad/zammad
synced 2026-05-24 09:48:36 +00:00
26 lines
681 B
TypeScript
26 lines
681 B
TypeScript
// Copyright (C) 2012-2026 Zammad Foundation, https://zammad-foundation.org/
|
|
|
|
import { toRef, unref } from 'vue'
|
|
|
|
import { useApplicationStore } from '#shared/stores/application.ts'
|
|
import type { ConfigList } from '#shared/types/store.ts'
|
|
|
|
import type { App } from 'vue'
|
|
|
|
declare module '@vue/runtime-core' {
|
|
export interface ComponentCustomProperties {
|
|
$c: ConfigList
|
|
}
|
|
}
|
|
|
|
const applicationConfigPlugin = (app: App) => {
|
|
const application = useApplicationStore()
|
|
const config = toRef(application, 'config')
|
|
|
|
Object.defineProperty(app.config.globalProperties, '$c', {
|
|
enumerable: true,
|
|
get: () => unref(config),
|
|
})
|
|
}
|
|
|
|
export default applicationConfigPlugin
|