2022-04-05 14:02:29 +00:00
|
|
|
<script setup>
|
2022-04-14 15:27:31 +00:00
|
|
|
const a = ref('')
|
2022-04-05 14:02:29 +00:00
|
|
|
useHead({
|
2022-08-02 11:20:44 +00:00
|
|
|
// title template function example
|
|
|
|
titleTemplate: title => `${title} - Title Template Fn Change`,
|
2022-04-05 14:02:29 +00:00
|
|
|
bodyAttrs: {
|
|
|
|
class: 'body-attrs-test'
|
|
|
|
},
|
2022-08-02 11:43:25 +00:00
|
|
|
script: [
|
|
|
|
{
|
|
|
|
src: 'https://a-body-appended-script.com',
|
|
|
|
body: true
|
|
|
|
}
|
|
|
|
],
|
2022-04-05 14:02:29 +00:00
|
|
|
meta: [{ name: 'description', content: 'first' }]
|
|
|
|
})
|
2022-04-14 15:27:31 +00:00
|
|
|
useHead({ charset: 'utf-16', meta: [{ name: 'description', content: computed(() => `${a.value} with an inline useHead call`) }] })
|
2022-04-05 14:02:29 +00:00
|
|
|
useMeta({ script: [{ children: 'console.log("works with useMeta too")' }] })
|
2022-04-14 15:27:31 +00:00
|
|
|
a.value = 'overriding'
|
2022-04-05 14:02:29 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
head () {
|
|
|
|
return {
|
|
|
|
htmlAttrs: {
|
|
|
|
class: 'html-attrs-test'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</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>
|