forked from nuxt/nuxt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.vue
81 lines (72 loc) · 2.09 KB
/
index.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<template>
<div>
<Head>
<Title>Basic fixture</Title>
</Head>
<h1>Hello Nuxt 3!</h1>
<div>RuntimeConfig | testConfig: {{ config.public.testConfig }}</div>
<div>Composable | foo: {{ foo }}</div>
<div>Composable | bar: {{ bar }}</div>
<div>Composable | template: {{ templateAutoImport }}</div>
<div>Composable | star: {{ useNestedBar() }}</div>
<DevOnly>Some dev-only info</DevOnly>
<div><DevOnly>Some dev-only info</DevOnly></div>
<div>
<DevOnly>
Some dev-only info
<template #fallback>
Some prod-only info
</template>
</DevOnly>
</div>
<div>Path: {{ $route.fullPath }}</div>
<NuxtLink to="/">
Link
</NuxtLink>
<NuxtLink to="/chunk-error" :prefetch="false">
Chunk error
</NuxtLink>
Some value: {{ someValue }}
<button @click="someValue++">
Increment state
</button>
<NuxtLink to="/no-scripts">
to no script
</NuxtLink>
<NestedSugarCounter :multiplier="2" />
<CustomComponent />
<Spin>Test</Spin>
<component :is="`test${'-'.toString()}global`" />
<component :is="`with${'-'.toString()}suffix`" />
<ClientWrapped ref="clientRef" style="color: red;" class="client-only" />
<ServerOnlyComponent class="server-only" style="background-color: gray;" />
</div>
</template>
<script setup lang="ts">
import { setupDevtoolsPlugin } from '@vue/devtools-api'
import { useRuntimeConfig } from '#imports'
import { importedRE, importedValue } from '~/some-exports'
setupDevtoolsPlugin({}, () => {}) as any
const config = useRuntimeConfig()
const someValue = useState('val', () => 1)
const NestedSugarCounter = resolveComponent('NestedSugarCounter')
if (!NestedSugarCounter) {
throw new Error('Component not found')
}
definePageMeta({
alias: '/some-alias',
other: ref('test'),
imported: importedValue,
something: importedRE.test('an imported regex')
})
// reset title template example
useHead({
titleTemplate: ''
})
const foo = useFoo()
const bar = useBar()
const clientRef = ref()
onMounted(() => {
clientRef.value.exposedFunc()
})
</script>