wangrong
2026-08-30 4c949c0dc9bcae785c281c9d8125295f09810b15
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<script setup lang="ts">
import { contextmenuStoreWithOut } from '@/store/modules/data-visualization/contextmenu'
import { storeToRefs } from 'pinia'
import ContextMenuDetails from '@/components/data-visualization/canvas/ContextMenuDetails.vue'
import { computed } from 'vue'
 
const props = withDefaults(
  defineProps<{
    showPosition?: string
  }>(),
  {
    showPosition: 'canvasCore'
  }
)
const contextmenuStore = contextmenuStoreWithOut()
 
const { menuTop, menuLeft, menuShow, position } = storeToRefs(contextmenuStore)
const menuDetailsShow = computed(() => menuShow.value && props.showPosition === position.value)
</script>
 
<template>
  <context-menu-details
    v-show="menuDetailsShow"
    class="contextmenu"
    :style="{ top: menuTop + 'px', left: menuLeft + 'px' }"
  ></context-menu-details>
</template>
 
<style lang="less" scoped>
.contextmenu {
  position: absolute;
}
</style>