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: {
|
2024-04-05 18:08:32 +00:00
|
|
|
class: 'html-attrs-test',
|
|
|
|
},
|
2022-04-05 14:02:29 +00:00
|
|
|
}
|
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: {
|
2024-04-05 18:08:32 +00:00
|
|
|
class: 'body-attrs-test',
|
2022-11-15 14:47:17 +00:00
|
|
|
},
|
|
|
|
script: [
|
|
|
|
{
|
|
|
|
src: 'https://a-body-appended-script.com',
|
2024-04-05 18:08:32 +00:00
|
|
|
body: true,
|
|
|
|
},
|
2022-11-15 14:47:17 +00:00
|
|
|
],
|
2024-04-05 18:08:32 +00:00
|
|
|
meta: [{ name: 'description', content: 'first' }],
|
2022-11-15 14:47:17 +00:00
|
|
|
})
|
|
|
|
useHead({ meta: [{ charset: 'utf-16' }, { name: 'description', content: computed(() => `${a.value} with an inline useHead call`) }] })
|
|
|
|
a.value = 'overriding'
|
2024-04-05 18:08:32 +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>
|
2023-11-09 17:01:13 +00:00
|
|
|
<Meta
|
|
|
|
http-equiv="content-security-policy"
|
|
|
|
content="default-src https"
|
|
|
|
/>
|
2022-04-05 14:02:29 +00:00
|
|
|
</Head>
|
|
|
|
</div>
|
|
|
|
</template>
|