mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
18 lines
421 B
Vue
18 lines
421 B
Vue
<script setup>
|
|
const counter = useState('counter', () => Math.round(Math.random() * 1000))
|
|
</script>
|
|
|
|
<template>
|
|
<NuxtExampleLayout example="composables/use-state">
|
|
<div>Counter: {{ counter }}</div>
|
|
<div>
|
|
<NButton class="font-mono" @click="counter++">
|
|
+
|
|
</NButton>
|
|
<NButton class="font-mono" @click="counter--">
|
|
-
|
|
</NButton>
|
|
</div>
|
|
</NuxtExampleLayout>
|
|
</template>
|