Nuxt/test/fixtures/basic/components/SugarCounter.vue

17 lines
355 B
Vue
Raw Normal View History

<script setup lang="ts">
const props = defineProps<{
2023-01-22 16:46:45 +00:00
multiplier: number
}>()
2023-01-22 16:46:45 +00:00
const count = $ref(12)
const doubled = $computed(() => count * props.multiplier)
</script>
<template>
2023-01-22 16:46:45 +00:00
<div class="sugar-counter">
Sugar Counter {{ count }} x {{ multiplier }} = {{ doubled }}
2023-01-22 16:46:45 +00:00
<button @click="count += 1">
Inc
</button>
</div>
</template>