-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.vue
39 lines (28 loc) · 818 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
<!--
* @Date: 2023-06-26 19:53:17
* @LastEditors: yikoyu [email protected]
* @LastEditTime: 2023-07-04 10:23:15
* @FilePath: \nuxt-template\pages\index.vue
-->
<script lang="ts" setup>
import dayjs from 'dayjs'
import { useUser } from '@/stores'
const config = useRuntimeConfig()
const { x, y } = useMouse()
const isDark = useDark()
const toggleDark = useToggle(isDark)
console.log('config.public.apiHost :>> ', config.public.apiHost)
const user = useUser()
function setToken() {
user.setToken(String(dayjs().unix()))
}
</script>
<template>
<NuxtLayout>
<div>这里是首页</div>
<div>x: {{ x }}, y: {{ y }}</div>
<div>{{ user.token }}</div>
<ElButton @click="setToken">set token</ElButton>
<ElButton @click="toggleDark()">Toggle Dark</ElButton>
</NuxtLayout>
</template>