refactor: set value emits
This commit is contained in:
parent
eca341ed5a
commit
c3a7aaba64
1 changed files with 12 additions and 4 deletions
|
|
@ -22,6 +22,14 @@ const props = withDefaults(
|
|||
buttomDownload: false,
|
||||
},
|
||||
);
|
||||
|
||||
defineEmits<{
|
||||
(e: 'view', index: number): void;
|
||||
(e: 'edit', index: number): void;
|
||||
(e: 'delete', index: number): void;
|
||||
(e: 'toggleStatus', row: typeof props.rows): void;
|
||||
(e: 'download', row: typeof props.rows): void;
|
||||
}>();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -51,7 +59,7 @@ const props = withDefaults(
|
|||
dense
|
||||
round
|
||||
flat
|
||||
@click.stop="$emit('view', props.row.index)"
|
||||
@click.stop="$emit('view', props.rowIndex)"
|
||||
/>
|
||||
|
||||
<q-btn
|
||||
|
|
@ -67,9 +75,9 @@ const props = withDefaults(
|
|||
<KebabAction
|
||||
:id-name="props.row.code"
|
||||
:status="props.row.status"
|
||||
@view="$emit('view', props.row)"
|
||||
@edit="$emit('edit', props.row)"
|
||||
@delete="$emit('delete', props.row)"
|
||||
@view="$emit('view', props.rowIndex)"
|
||||
@edit="$emit('edit', props.rowIndex)"
|
||||
@delete="$emit('delete', props.rowIndex)"
|
||||
@change-status="$emit('toggleStatus', props.row)"
|
||||
/>
|
||||
</q-td>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue