2022-04-05 14:02:29 +00:00
|
|
|
<script>
|
2022-11-15 14:47:17 +00:00
|
|
|
export default defineNuxtComponent({
|
2022-04-05 14:02:29 +00:00
|
|
|
head () {
|
|
|
|
return {
|
|
|
|
htmlAttrs: {
|
|
|
|
class: 'html-attrs-test'
|
|
|
|
}
|
|
|
|
}
|
2022-11-15 14:47:17 +00:00
|
|
|
},
|
|
|
|
setup () {
|
|
|
|
const a = ref('')
|
|
|
|
useHead({
|
|
|
|
// title template function example
|
|
|
|
titleTemplate: title => `${title} - Title Template Fn Change`,
|
|
|
|
bodyAttrs: {
|
|
|
|
class: 'body-attrs-test'
|
|
|
|
},
|
|
|
|
script: [
|
|
|
|
{
|
|
|
|
src: 'https://a-body-appended-script.com',
|
|
|
|
body: true
|
|
|
|
}
|
|
|
|
],
|
|
|
|
meta: [{ name: 'description', content: 'first' }]
|
|
|
|
})
|
|
|
|
useHead({ meta: [{ charset: 'utf-16' }, { name: 'description', content: computed(() => `${a.value} with an inline useHead call`) }] })
|
|
|
|
a.value = 'overriding'
|
2022-04-05 14:02:29 +00:00
|
|
|
}
|
2022-11-15 14:47:17 +00:00
|
|
|
})
|
2022-04-05 14:02:29 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<Head>
|
|
|
|
<Title>Using a dynamic component</Title>
|
2022-09-03 12:31:09 +00:00
|
|
|
<Meta http-equiv="content-security-policy" content="default-src https" />
|
2022-04-05 14:02:29 +00:00
|
|
|
</Head>
|
|
|
|
</div>
|
|
|
|
</template>
|