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">
|
<script lang="ts" setup name="MEditorLayerMenu">
|
||||||
import { computed, inject, markRaw, ref } from 'vue';
|
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';
|
import { NodeType } from '@tmagic/schema';
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ const menuData = computed<(MenuButton | MenuComponent)[]>(() => [
|
|||||||
{
|
{
|
||||||
type: 'button',
|
type: 'button',
|
||||||
text: '复制',
|
text: '复制',
|
||||||
icon: markRaw(DocumentCopy),
|
icon: markRaw(CopyDocument),
|
||||||
display: () => !isRoot.value,
|
display: () => !isRoot.value,
|
||||||
handler: () => {
|
handler: () => {
|
||||||
node.value && services?.editorService.copy(node.value);
|
node.value && services?.editorService.copy(node.value);
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
<script lang="ts" setup name="MEditorViewerMenu">
|
<script lang="ts" setup name="MEditorViewerMenu">
|
||||||
import { computed, inject, markRaw, ref, watch } from 'vue';
|
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 { MNode, NodeType } from '@tmagic/schema';
|
||||||
import StageCore from '@tmagic/stage';
|
import StageCore from '@tmagic/stage';
|
||||||
@ -44,7 +44,7 @@ const menuData = computed<(MenuButton | MenuComponent)[]>(() => [
|
|||||||
{
|
{
|
||||||
type: 'button',
|
type: 'button',
|
||||||
text: '复制',
|
text: '复制',
|
||||||
icon: markRaw(DocumentCopy),
|
icon: markRaw(CopyDocument),
|
||||||
handler: () => {
|
handler: () => {
|
||||||
nodes.value && editorService?.copy(nodes.value);
|
nodes.value && editorService?.copy(nodes.value);
|
||||||
canPaste.value = true;
|
canPaste.value = true;
|
||||||
@ -53,6 +53,7 @@ const menuData = computed<(MenuButton | MenuComponent)[]>(() => [
|
|||||||
{
|
{
|
||||||
type: 'button',
|
type: 'button',
|
||||||
text: '粘贴',
|
text: '粘贴',
|
||||||
|
icon: markRaw(DocumentCopy),
|
||||||
display: () => canPaste.value,
|
display: () => canPaste.value,
|
||||||
handler: () => {
|
handler: () => {
|
||||||
const rect = menu.value?.$el.getBoundingClientRect();
|
const rect = menu.value?.$el.getBoundingClientRect();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user