generated from kn0wn/vitesse-lite
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.vue
45 lines (39 loc) · 970 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
<template>
<div>
<p>
<a href="https://github.com/antfu/vitesse" target="_blank"> Vitesse </a>
</p>
<p class="text-sm opacity-50">
<em>intro</em>
</p>
<div class="py-4" />
<input
v-model="name"
placeholder="What's your name"
class="px-4 py-2 border border-gray-200 rounded text-center text-sm outline-none active:outline-none bg-transparent dark:border-gray-700"
style="width: 250px"
@keydown.enter="go"
/>
<div>
<button class="btn m-3 text-sm" :disabled="!name" @click="go">go</button>
</div>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue'
import { ref } from 'vue'
import { useRouter } from 'vue-router'
export default defineComponent({
setup() {
const name = ref('')
const router = useRouter()
const go = () => {
if (name.value) router.push(`/hi/${name.value}`)
}
return {
go,
name
}
}
})
</script>