implement toolbar actions

This commit is contained in:
2023-05-13 07:17:27 +02:00
parent c54057ebba
commit f96d139b55
4 changed files with 67 additions and 25 deletions

View File

@@ -1,7 +1,7 @@
<script setup lang="ts">
const emit = defineEmits<{
delete: []
setRoot: []
delete: [close: () => void]
setRoot: [close: () => void]
}>()
</script>
<template>
@@ -18,9 +18,9 @@ const emit = defineEmits<{
<i class="fas fa-fw fa-trash" />
</button>
</template>
<template #default>Are you sure you want to delete this?</template>
<template #default>Are you sure you want to delete this note?</template>
<template #actions="{ close }">
<button class="btn-primary btn-sm btn mr-1" @click="emit('delete')">
<button class="btn-primary btn-sm btn mr-1" @click="emit('delete', close)">
Delete note
</button>
<button class="btn-sm btn" @click="close">Close</button>
@@ -36,7 +36,7 @@ const emit = defineEmits<{
Are you sure you want to set this note as root note?
</template>
<template #actions="{ close }">
<button class="btn-primary btn-sm btn mr-1" @click="emit('setRoot')">
<button class="btn-primary btn-sm btn mr-1" @click="emit('setRoot', close)">
Set current note as root
</button>
<button class="btn-sm btn" @click="close">Close</button>