Nuxt/examples/use-meta/app.vue
2021-10-12 14:51:41 +02:00

33 lines
585 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">
export default {
setup () {
useMeta({
bodyAttrs: {
class: 'test'
}
})
return { dynamic: ref(49) }
},
head: {
title: 'Another title'
}
}
</script>