mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-16 02:44:51 +00:00
20 lines
319 B
Vue
20 lines
319 B
Vue
<template>
|
|
<div>
|
|
Page visits: {{ data.count }}
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { defineNuxtComponent, asyncData } from '@nuxt/app'
|
|
|
|
export default defineNuxtComponent({
|
|
setup () {
|
|
const { data } = asyncData('time', () => $fetch('/api/count'))
|
|
|
|
return {
|
|
data
|
|
}
|
|
}
|
|
})
|
|
</script>
|