tethys/resources/assets/js/components/CustomActions.vue
2020-06-10 21:09:12 +02:00

38 lines
812 B
Vue

<template>
<div class="custom-actions">
<button class="view" @click="itemAction('view-item', rowData, rowIndex)">
</button>
<a class="edit" @click="itemAction('edit-item', rowData, rowIndex)">
</a>
<a class="delete" @click="itemAction('delete-item', rowData, rowIndex)">
</a>
</div>
</template>
<script>
export default {
props: {
rowData: {
type: Object,
required: true
},
rowIndex: {
type: Number
}
},
methods: {
itemAction(action, data, index) {
console.log("custom-actions: " + action, data.full_name, index);
}
}
};
</script>
<style>
.custom-actions button.ui.button {
padding: 8px 8px;
}
.custom-actions button.ui.button > i.icon {
margin: auto !important;
}
</style>