wip: shopping cart

This commit is contained in:
Nikita Kiselev
2025-07-21 14:24:05 +03:00
parent e3cc0d4b10
commit ce2c9e374d
5 changed files with 53 additions and 38 deletions

View File

@@ -16,5 +16,4 @@ import OptionTextarea from "./Types/OptionTextarea.vue";
import OptionSelect from "./Types/OptionSelect.vue";
const options = defineModel();
</script>

View File

@@ -16,7 +16,7 @@
class="absolute inset-0 appearance-none focus:outline-none disabled:cursor-not-allowed"
/>
<span class="text-xs font-medium">
<span class="text-xs font-medium">
{{ value.name }}<span v-if="value.price"> ({{ value.price_prefix }}{{ value.price }})</span>
</span>
</label>

View File

@@ -1,15 +1,29 @@
<template>
<div class="flex items-center text-center">
<button class="btn btn-lg" @click="inc">-</button>
<button class="btn" :class="btnClassList" @click="inc">-</button>
<div class="w-10 h-10 flex items-center justify-center font-bold">{{ model }}</div>
<button class="btn btn-lg" @click="dec">+</button>
<button class="btn" :class="btnClassList" @click="dec">+</button>
</div>
</template>
<script setup>
import {computed} from "vue";
const model = defineModel();
const props = defineProps({
max: Number,
size: {
type: String,
default: '',
}
});
const btnClassList = computed(() => {
let classList = ['btn'];
if (props.size) {
classList.push(`btn-${props.size}`);
}
return classList;
});
function inc() {