refactor: kebab link, upload

This commit is contained in:
puriphatt 2024-09-19 13:30:44 +07:00
parent cfbc1866f7
commit bea936a7a0

View file

@ -9,6 +9,9 @@ const props = withDefaults(
idName: string;
status: string;
hideToggle?: boolean;
useLink?: boolean;
useUpload?: boolean;
disableDelete?: boolean;
}>(),
{
@ -20,6 +23,8 @@ const props = withDefaults(
defineEmits<{
(e: 'view'): void;
(e: 'edit'): void;
(e: 'link'): void;
(e: 'upload'): void;
(e: 'delete'): void;
(e: 'changeStatus'): void;
}>();
@ -87,6 +92,49 @@ watch(
{{ $t('general.edit') }}
</span>
</q-item>
<q-item
v-if="status !== 'INACTIVE' && useLink"
v-close-popup
dense
clickable
class="row q-py-sm"
style="white-space: nowrap"
:id="`btn-kebab-edit-${idName}`"
@click.stop="() => $emit('link')"
>
<q-icon
size="xs"
class="col-3"
name="mdi-link-variant"
style="color: hsl(var(--yellow-6-hsl))"
/>
<span class="col-9 q-px-md flex items-center">
{{ $t('general.add', { text: $t('quotation.receipt') }) }}
</span>
</q-item>
<q-item
v-if="status !== 'INACTIVE' && useUpload"
v-close-popup
dense
clickable
class="row q-py-sm"
style="white-space: nowrap"
:id="`btn-kebab-edit-${idName}`"
@click.stop="() => $emit('upload')"
>
<q-icon
size="xs"
class="col-3"
name="mdi-upload"
style="color: hsl(var(--blue-10-hsl))"
/>
<span class="col-9 q-px-md flex items-center">
{{ $t('general.upload', { msg: $t('general.attachment') }) }}
</span>
</q-item>
<q-item
v-if="status !== 'INACTIVE'"
v-close-popup