mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-08-27 09:19:55 +08:00
fix(editor): 画布右键菜单中粘贴按钮显示条件修改
This commit is contained in:
parent
23617a63e9
commit
beee67b3eb
@ -3,7 +3,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, inject, markRaw, onMounted, reactive, ref, watch } from 'vue';
|
import { computed, inject, markRaw, reactive, ref, watch } from 'vue';
|
||||||
import { Bottom, Delete, DocumentCopy, Top } from '@element-plus/icons-vue';
|
import { Bottom, Delete, DocumentCopy, Top } from '@element-plus/icons-vue';
|
||||||
|
|
||||||
import { MNode, NodeType } from '@tmagic/schema';
|
import { MNode, NodeType } from '@tmagic/schema';
|
||||||
@ -133,11 +133,6 @@ const menuData = reactive<MenuItem[]>([
|
|||||||
...stageContentMenu,
|
...stageContentMenu,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
onMounted(async () => {
|
|
||||||
const data = await storageService.getItem(COPY_STORAGE_KEY);
|
|
||||||
canPaste.value = data !== 'undefined' && !!data;
|
|
||||||
});
|
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
parent,
|
parent,
|
||||||
async () => {
|
async () => {
|
||||||
@ -152,8 +147,10 @@ watch(
|
|||||||
{ immediate: true },
|
{ immediate: true },
|
||||||
);
|
);
|
||||||
|
|
||||||
const show = (e: MouseEvent) => {
|
const show = async (e: MouseEvent) => {
|
||||||
menu.value?.show(e);
|
menu.value?.show(e);
|
||||||
|
const data = await storageService.getItem(COPY_STORAGE_KEY);
|
||||||
|
canPaste.value = data !== 'undefined' && !!data;
|
||||||
};
|
};
|
||||||
|
|
||||||
defineExpose({ show });
|
defineExpose({ show });
|
||||||
|
Loading…
x
Reference in New Issue
Block a user