mirror of
https://github.com/nuxt/nuxt.git
synced 2024-12-05 03:47:12 +00:00
15 lines
306 B
Vue
15 lines
306 B
Vue
|
<script setup>
|
||
|
const counter = useState('once', () => 0)
|
||
|
|
||
|
await callOnce(() => counter.value++)
|
||
|
await callOnce('same-key', () => counter.value++)
|
||
|
await callOnce('same-key', () => counter.value++)
|
||
|
</script>
|
||
|
|
||
|
<template>
|
||
|
<div>
|
||
|
<div>once.vue</div>
|
||
|
<div>once: {{ counter }}</div>
|
||
|
</div>
|
||
|
</template>
|