Nuxt/examples/meta/app.vue
Daniel Roe b263b4f930
feat: @nuxt/meta module for head rendering (#179)
Co-authored-by: Anthony Fu <hi@antfu.me>
Co-authored-by: Pooya Parsa <pyapar@gmail.com>
2021-07-15 13:28:04 +02:00

35 lines
647 B
Vue

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