forked from nuxt/framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.vue
42 lines (39 loc) · 1.11 KB
/
app.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<template>
<NuxtExampleLayout example="composables/use-head">
<div
class="bg-gray-400/10 border-2 border-dashed border-gray-400/50 rounded-xl py-8 px-2 op-80"
>
There are renderless <code><Html></code>, <code><Meta></code>, <code><Title></code> components
<br>that can magically bind the meta using Vue template.
</div>
<Html :lang="String(dynamic)">
<Head>
<Title>Luck number: {{ dynamic }}</Title>
<Meta name="description" :content="`My page's ${dynamic} description`" />
<Link rel="preload" href="/test.txt" as="script" />
<Script>console.log("hello script");</Script>
</Head>
</Html>
<div class="mt-5">
<NButton @click="dynamic = Math.round(Math.random() * 100)">
Click me and see the dynamic title
</NButton>
</div>
</NuxtExampleLayout>
</template>
<script>
export default {
setup () {
useHead({
titleTemplate: '%s - useHead example',
bodyAttrs: {
class: 'test'
}
})
return { dynamic: ref(49) }
},
head: {
title: 'Another title'
}
}
</script>