2022-03-11 13:05:16 +00:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { ref } from 'vue';
|
|
|
|
const props = defineProps({
|
|
|
|
incrementStep: {
|
|
|
|
type: Number,
|
|
|
|
default: 1,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
const counter = ref(0);
|
|
|
|
const input = ref('rocket muffin');
|
|
|
|
function increment() {
|
|
|
|
counter.value += props.incrementStep;
|
|
|
|
}
|
|
|
|
</script>
|
2022-03-11 10:25:30 +00:00
|
|
|
|
|
|
|
<template>
|
2022-03-11 10:39:56 +00:00
|
|
|
<div>
|
|
|
|
<p class="content">{{ input }}</p>
|
|
|
|
<span>{{ counter }}</span>
|
|
|
|
<q-btn class="button" @click="increment()"></q-btn>
|
|
|
|
</div>
|
2022-03-11 10:25:30 +00:00
|
|
|
</template>
|