forked from antfu-collective/vitesse-lite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.vue
46 lines (40 loc) · 878 Bytes
/
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
<script setup lang="ts" generic="T extends any, O extends any">
defineOptions({
name: 'IndexPage',
})
const name = ref('')
const router = useRouter()
function go() {
if (name.value)
router.push(`/hi/${encodeURIComponent(name.value)}`)
}
</script>
<template>
<div>
<div i-carbon-campsite inline-block text-4xl />
<p>
<a rel="noreferrer" href="https://github.com/antfu-collective/vitesse-lite" target="_blank">
Vitesse Lite
</a>
</p>
<p>
<em text-sm op75>Opinionated Vite Starter Template</em>
</p>
<div py-4 />
<TheInput
v-model="name"
placeholder="What's your name?"
autocomplete="false"
@keydown.enter="go"
/>
<div>
<button
class="m-3 text-sm btn"
:disabled="!name"
@click="go"
>
Go
</button>
</div>
</div>
</template>