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

18 lines
417 B
Vue
Raw Permalink Normal View History

<script setup lang="ts">
2023-01-22 16:46:45 +00:00
// eslint-disable-next-line vue/no-setup-props-destructure
const { multiplier } = defineProps<{
multiplier: number
}>()
2023-01-22 16:46:45 +00:00
const count = $ref(12)
const doubled = $computed(() => count * 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>