refactor: product item delete (incomplete)
This commit is contained in:
parent
c51f664beb
commit
23dc6858c6
2 changed files with 7 additions and 3 deletions
|
|
@ -13,7 +13,7 @@ const priceData = defineModel<{
|
||||||
});
|
});
|
||||||
|
|
||||||
defineEmits<{
|
defineEmits<{
|
||||||
(e: 'delete'): void;
|
(e: 'delete', index: number): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
withDefaults(
|
withDefaults(
|
||||||
|
|
@ -103,7 +103,7 @@ const columns = [
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
imgColumn="name"
|
imgColumn="name"
|
||||||
:customColumn="['amount', 'pricePerUnit', 'discount', 'tax', 'sumPrice']"
|
:customColumn="['amount', 'pricePerUnit', 'discount', 'tax', 'sumPrice']"
|
||||||
@delete="$emit('delete')"
|
@delete="(i) => $emit('delete', i)"
|
||||||
>
|
>
|
||||||
<template v-slot:img-column="{ props }">
|
<template v-slot:img-column="{ props }">
|
||||||
<q-avatar class="q-mr-sm" size="md">
|
<q-avatar class="q-mr-sm" size="md">
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,11 @@ defineEmits<{
|
||||||
<template v-slot:body-cell-action="props">
|
<template v-slot:body-cell-action="props">
|
||||||
<q-td class="text-center row items-center">
|
<q-td class="text-center row items-center">
|
||||||
<slot name="button" :props="props"></slot>
|
<slot name="button" :props="props"></slot>
|
||||||
<DeleteButton iconOnly v-if="buttonDelete" />
|
<DeleteButton
|
||||||
|
iconOnly
|
||||||
|
v-if="buttonDelete"
|
||||||
|
@click="$emit('delete', props.rowIndex)"
|
||||||
|
/>
|
||||||
|
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="!buttonDelete"
|
v-if="!buttonDelete"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue