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

18 lines
414 B
Vue
Raw Permalink Normal View History

<!-- eslint-disable vue/multi-word-component-names -->
<script setup lang="ts">
const props = defineProps<{
2023-01-22 16:46:45 +00:00
multiplier: number
}>()
const count = ref(12)
const doubled = computed(() => count.value * 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>