feat(editor): 添加右键菜单粘贴icon

This commit is contained in:
roymondchen 2022-11-18 16:22:42 +08:00
parent 54bc196685
commit 813ca55ef6
2 changed files with 5 additions and 4 deletions

View File

@ -4,7 +4,7 @@
<script lang="ts" setup name="MEditorLayerMenu">
import { computed, inject, markRaw, ref } from 'vue';
import { Delete, DocumentCopy, Files, Plus } from '@element-plus/icons-vue';
import { CopyDocument, Delete, Files, Plus } from '@element-plus/icons-vue';
import { NodeType } from '@tmagic/schema';
@ -84,7 +84,7 @@ const menuData = computed<(MenuButton | MenuComponent)[]>(() => [
{
type: 'button',
text: '复制',
icon: markRaw(DocumentCopy),
icon: markRaw(CopyDocument),
display: () => !isRoot.value,
handler: () => {
node.value && services?.editorService.copy(node.value);

View File

@ -4,7 +4,7 @@
<script lang="ts" setup name="MEditorViewerMenu">
import { computed, inject, markRaw, ref, watch } from 'vue';
import { Bottom, Delete, DocumentCopy, Top } from '@element-plus/icons-vue';
import { Bottom, CopyDocument, Delete, DocumentCopy, Top } from '@element-plus/icons-vue';
import { MNode, NodeType } from '@tmagic/schema';
import StageCore from '@tmagic/stage';
@ -44,7 +44,7 @@ const menuData = computed<(MenuButton | MenuComponent)[]>(() => [
{
type: 'button',
text: '复制',
icon: markRaw(DocumentCopy),
icon: markRaw(CopyDocument),
handler: () => {
nodes.value && editorService?.copy(nodes.value);
canPaste.value = true;
@ -53,6 +53,7 @@ const menuData = computed<(MenuButton | MenuComponent)[]>(() => [
{
type: 'button',
text: '粘贴',
icon: markRaw(DocumentCopy),
display: () => canPaste.value,
handler: () => {
const rect = menu.value?.$el.getBoundingClientRect();