mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-22 07:50:36 +01:00
fix(vue): missing unhead context (#3589)
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
@@ -3,6 +3,11 @@ import type { Plugin } from 'vue'
|
||||
|
||||
export default {
|
||||
install(app) {
|
||||
// check for existing head instance to avoid replacement
|
||||
// bit hacky but we can't use injectHead() here
|
||||
if (app._context.provides.usehead) {
|
||||
return
|
||||
}
|
||||
const head = createHead()
|
||||
app.use(head)
|
||||
}
|
||||
|
||||
@@ -61,7 +61,6 @@ export const useState = <T>(key: string, init: () => T): Ref<T> => {
|
||||
export function useNuxtApp() {
|
||||
return {
|
||||
isHydrating: true,
|
||||
isVue: true,
|
||||
payload: { serverRendered: false }
|
||||
}
|
||||
}
|
||||
@@ -69,7 +68,7 @@ export function useNuxtApp() {
|
||||
export function defineNuxtPlugin(plugin: (nuxtApp: NuxtApp) => void) {
|
||||
return {
|
||||
install(app) {
|
||||
plugin({ vueApp: app } as NuxtApp)
|
||||
app.runWithContext(() => plugin({ vueApp: app } as NuxtApp))
|
||||
}
|
||||
} satisfies VuePlugin
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user