forked from antfu-collective/vitesse-lite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.tsx
54 lines (46 loc) · 1014 Bytes
/
index.tsx
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
export default defineComponent(() => {
const name = ref('')
const router = useRouter()
function go() {
if (name.value)
router.push(`/hi/${encodeURIComponent(name.value)}`)
}
const route = useRoute('/')
return () => (
<div>
<div i-carbon-campsite inline-block text-4xl />
<p>
<a rel="noreferrer" href="https://github.com/vue-macros/vitesse-jsx" target="_blank">
Vitesse
{' '}
{route.meta.title}
</a>
</p>
<p>
<em text-sm op75>Opinionated Vite Starter Template</em>
</p>
<div py-4 />
<TheCounter />
<TheInput
v-model={name.value}
placeholder="What's your name?"
autocomplete="false"
onKeydown_enter={go}
/>
<div>
<button
class="m-3 text-sm btn"
disabled={!name}
onClick={go}
>
Go
</button>
</div>
</div>
)
})
definePage({
meta: {
layout: 'home',
},
})