Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
fix(nuxt): remove left-over titleTemplate handling
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Aug 10, 2022
1 parent 97f0fa5 commit a5177bf
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
10 changes: 0 additions & 10 deletions packages/nuxt/src/head/runtime/lib/vueuse-head.plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,10 @@ export default defineNuxtPlugin((nuxtApp) => {
headReady = true
})

const titleTemplate = ref<MetaObject['titleTemplate']>()

nuxtApp._useHead = (_meta: MetaObject | ComputedGetter<MetaObject>) => {
const meta = ref<MetaObject>(_meta)
if ('titleTemplate' in meta.value) {
titleTemplate.value = meta.value.titleTemplate
}

const headObj = computed(() => {
const overrides: MetaObject = { meta: [] }
// cast a null titleTemplate to an empty string so @vueuse/head ignores it
if (titleTemplate.value === null) {
overrides.titleTemplate = ''
}
if (meta.value.charset) {
overrides.meta!.push({ key: 'charset', charset: meta.value.charset })
}
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/basic/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const config = useRuntimeConfig()
// reset title template example
useHead({
titleTemplate: null
titleTemplate: ''
})
const foo = useFoo()
Expand Down

0 comments on commit a5177bf

Please sign in to comment.