feat: add custom BottomButton instead of TG

This commit is contained in:
Nikita Kiselev
2025-07-21 00:48:34 +03:00
parent c282b6ea3b
commit b0cc0237af
4 changed files with 90 additions and 32 deletions

View File

@@ -0,0 +1,29 @@
<template>
<div class="flex items-center text-center">
<button class="btn btn-neutral w-10 h-10" @click="inc">-</button>
<div class="w-10 h-10 flex items-center justify-center bg-neutral">{{ model }}</div>
<button class="btn btn-neutral w-10 h-10" @click="dec">+</button>
</div>
</template>
<script setup>
const model = defineModel();
const props = defineProps({
max: Number,
});
function inc() {
if (model.value - 1 >= 0) {
model.value--;
}
}
function dec() {
if (props.max && model.value + 1 > props.max) {
model.value = props.max;
return;
}
model.value++;
}
</script>