mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +08:00
feat(editor): 添加右键菜单粘贴icon
This commit is contained in:
parent
54bc196685
commit
813ca55ef6
@ -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);
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user