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
import { defineStore } from 'pinia'
import { store } from '../../index'
 
export const contextmenuStore = defineStore('contextmenu', {
  state: () => {
    return {
      menuTop: 0, // 右击菜单数据
      menuLeft: 0,
      menuShow: false,
      position: 'canvasCore'
    }
  },
  actions: {
    showContextMenu({ top, left, position }) {
      this.menuShow = true
      this.menuTop = top
      this.menuLeft = left
      this.position = position
    },
 
    hideContextMenu() {
      this.menuShow = false
    }
  }
})
 
export const contextmenuStoreWithOut = () => {
  return contextmenuStore(store)
}