mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 01:17:16 +00:00
17 lines
390 B
Vue
17 lines
390 B
Vue
|
<script setup>
|
||
|
const count = ref(1)
|
||
|
const { data } = await useFetch(() => `/api/hello/${count.value}`, { params: { token: 123 } })
|
||
|
</script>
|
||
|
|
||
|
<template>
|
||
|
<NuxtExampleLayout example="use-fetch">
|
||
|
<div>
|
||
|
Fetch result:
|
||
|
<pre class="text-left"><code>{{ data }}</code></pre>
|
||
|
<NButton @click="count++">
|
||
|
+
|
||
|
</NButton>
|
||
|
</div>
|
||
|
</NuxtExampleLayout>
|
||
|
</template>
|