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<{
|
||||
(e: 'delete'): void;
|
||||
(e: 'delete', index: number): void;
|
||||
}>();
|
||||
|
||||
withDefaults(
|
||||
|
|
@ -103,7 +103,7 @@ const columns = [
|
|||
:rows="rows"
|
||||
imgColumn="name"
|
||||
:customColumn="['amount', 'pricePerUnit', 'discount', 'tax', 'sumPrice']"
|
||||
@delete="$emit('delete')"
|
||||
@delete="(i) => $emit('delete', i)"
|
||||
>
|
||||
<template v-slot:img-column="{ props }">
|
||||
<q-avatar class="q-mr-sm" size="md">
|
||||
|
|
|
|||
|
|
@ -88,7 +88,11 @@ defineEmits<{
|
|||
<template v-slot:body-cell-action="props">
|
||||
<q-td class="text-center row items-center">
|
||||
<slot name="button" :props="props"></slot>
|
||||
<DeleteButton iconOnly v-if="buttonDelete" />
|
||||
<DeleteButton
|
||||
iconOnly
|
||||
v-if="buttonDelete"
|
||||
@click="$emit('delete', props.rowIndex)"
|
||||
/>
|
||||
|
||||
<q-btn
|
||||
v-if="!buttonDelete"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue