-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ee92808
commit 4ac5efb
Showing
3 changed files
with
143 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
...board-collaborative-text-editor-element/components/CollaborativeTextEditorElementMenu.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<template> | ||
<BoardMenu scope="element"> | ||
<BoardMenuActionMoveUp @click="onMoveUp" /> | ||
<BoardMenuActionMoveDown @click="onMoveDown" /> | ||
<BoardMenuActionDelete @click="onDelete" /> | ||
</BoardMenu> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { | ||
mdiArrowCollapseDown, | ||
mdiArrowCollapseUp, | ||
mdiCogOutline, | ||
mdiTrashCanOutline, | ||
} from "@mdi/js"; | ||
import { | ||
BoardMenu, | ||
BoardMenuActionDelete, | ||
BoardMenuActionMoveDown, | ||
BoardMenuActionMoveUp, | ||
} from "@ui-board"; | ||
import { defineComponent } from "vue"; | ||
export default defineComponent({ | ||
components: { | ||
BoardMenu, | ||
BoardMenuActionDelete, | ||
BoardMenuActionMoveUp, | ||
BoardMenuActionMoveDown, | ||
}, | ||
emits: [ | ||
"edit:element", | ||
"delete:element", | ||
"move-down:element", | ||
"move-up:element", | ||
], | ||
setup(_, { emit }) { | ||
const onEdit = () => emit("edit:element"); | ||
const onDelete = async (confirmation: Promise<boolean>) => { | ||
const shouldDelete = await confirmation; | ||
if (shouldDelete) { | ||
emit("delete:element"); | ||
} | ||
}; | ||
const onMoveDown = () => emit("move-down:element"); | ||
const onMoveUp = () => emit("move-up:element"); | ||
return { | ||
mdiArrowCollapseUp, | ||
mdiArrowCollapseDown, | ||
mdiTrashCanOutline, | ||
mdiCogOutline, | ||
onEdit, | ||
onDelete, | ||
onMoveDown, | ||
onMoveUp, | ||
}; | ||
}, | ||
}); | ||
</script> |