Nuxt/examples/use-meta/app.vue
Daniel Roe abfbd2f34e
feat: add <Html> meta component (#1820)
Co-authored-by: Sébastien Chopin <seb@nuxtjs.com>
Co-authored-by: Pooya Parsa <pyapar@gmail.com>
2021-11-10 21:25:29 +01:00

35 lines
621 B
Vue

<template>
<div>
Hello World
<Html :lang="String(dynamic)">
<Head>
<Title>{{ dynamic }} title</Title>
<Meta name="description" :content="`My page's ${dynamic} description`" />
<Link rel="preload" href="/test.txt" as="script" />
</Head>
</Html>
<button class="blue" @click="dynamic = Math.random() * 100">
Clickme
</button>
</div>
</template>
<script lang="ts">
export default {
setup () {
useMeta({
bodyAttrs: {
class: 'test'
}
})
return { dynamic: ref(49) }
},
head: {
title: 'Another title'
}
}
</script>