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