Browse Source

chore(gui-v2): correct shims and remove typecast

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
pull/2716/head
Braks 2 years ago committed by Pranav C
parent
commit
923a56ec21
  1. 11
      packages/nc-gui-v2/nuxt-shim.d.ts
  2. 2
      packages/nc-gui-v2/plugins/i18n.ts
  3. 2
      packages/nc-gui-v2/plugins/state.ts

11
packages/nc-gui-v2/nuxt-shim.d.ts vendored

@ -1,11 +1,12 @@
import type { RemovableRef } from '@vueuse/core' import type { RemovableRef } from '@vueuse/core'
import type { Api } from 'nocodb-sdk' import type { Api } from 'nocodb-sdk'
import type { VueI18n } from 'vue-i18n' import type { I18n } from 'vue-i18n'
import type { NuxtApp as BaseApp } from '#app/nuxt'
import type { GlobalState } from '~/lib/types' import type { GlobalState } from '~/lib/types'
import type messages from '@intlify/vite-plugin-vue-i18n/messages'
declare module '#app/nuxt' { declare module '#app/nuxt' {
interface NuxtApp extends BaseApp { interface NuxtApp {
$api: Api<any>; $api: Api<any>;
$tele: { $tele: {
emit: (event: string, data: any) => void emit: (event: string, data: any) => void
@ -16,8 +17,8 @@ declare module '#app/nuxt' {
} }
} }
declare module 'vue' { declare module '@vue/runtime-core' {
interface App { interface App {
i18n: VueI18n i18n: I18n<messages, unknown, unknown, false>['global']
} }
} }

2
packages/nc-gui-v2/plugins/i18n.ts

@ -48,7 +48,7 @@ export default defineNuxtPlugin(async (nuxtApp) => {
}, },
}) })
;(nuxtApp.vueApp as any).i18n = i18n.global nuxtApp.vueApp.i18n = i18n.global
nuxtApp.vueApp.use(i18n) nuxtApp.vueApp.use(i18n)
}) })

2
packages/nc-gui-v2/plugins/state.ts

@ -17,7 +17,7 @@ export default defineNuxtPlugin((nuxtApp) => {
const storage = useGlobalState() const storage = useGlobalState()
/** set i18n locale to stored language */ /** set i18n locale to stored language */
nuxtApp.vueApp.i18n.locale = storage.lang.value nuxtApp.vueApp.i18n.locale.value = storage.lang.value
nuxtApp.provide('state', storage) nuxtApp.provide('state', storage)
}) })

Loading…
Cancel
Save