hrms-edm/Services/client/src/components/FileItemAction.vue

71 lines
1.4 KiB
Vue
Raw Normal View History

2023-11-23 08:47:44 +07:00
<script lang="ts" setup>
import { ref } from 'vue'
2023-12-04 16:41:10 +07:00
defineEmits(['edit', 'delete'])
2023-12-04 16:41:10 +07:00
const props = defineProps<{
nameId: string
}>()
2023-12-04 16:41:10 +07:00
const open = ref(false)
2023-11-23 08:47:44 +07:00
</script>
<template>
<q-btn
@click.stop
icon="more_vert"
color="grey"
flat
dense
:data-testid="`action${props.nameId}`"
>
<q-menu v-model="open">
2023-11-23 08:47:44 +07:00
<q-list dense>
<q-item
clickable
id="FileltemActionEdit"
@click.stop="
() => {
open = false
$emit('edit')
}
"
>
2023-12-01 11:47:42 +07:00
<q-item-section>
2023-12-04 02:45:11 +00:00
<div class="row items-center white">
2023-12-06 11:39:37 +07:00
<q-icon name="o_edit" color="positive" />
<span class="q-ml-sm">แกไข</span>
2023-11-23 08:47:44 +07:00
</div>
</q-item-section>
</q-item>
2023-12-04 02:45:11 +00:00
<q-item
clickable
@click.stop="
() => {
open = false
$emit('delete')
}
"
2023-12-04 02:45:11 +00:00
id="FileltemActiondelete"
>
2023-12-01 11:47:42 +07:00
<q-item-section>
2023-12-04 02:45:11 +00:00
<div class="row items-center white">
<q-icon name="mdi-trash-can-outline" color="negative" />
2023-11-23 08:47:44 +07:00
<span class="q-ml-sm">ลบ</span>
</div>
</q-item-section>
</q-item>
</q-list>
</q-menu>
</q-btn>
</template>
2023-12-01 11:47:42 +07:00
<style scoped>
2023-12-04 02:45:11 +00:00
.white {
2023-12-01 11:47:42 +07:00
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
2023-12-04 02:45:11 +00:00
display: block;
2023-12-01 11:47:42 +07:00
}
</style>