@zhangqingcq/vgce 0.0.30 → 0.0.32

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,12 +4,29 @@ import type { IConfigItem } from '@/config/types'
4
4
  import { EDoneJsonType } from '@/config/types'
5
5
  import type { IDoneJson, IPointCoordinate } from '@/stores/global/types'
6
6
  import { EGlobalStoreIntention, EMouseInfoState } from '@/stores/global/types'
7
- import { straight_line_system } from '@/components/config'
8
7
  import { useGlobalStore } from '@/stores/global'
9
8
  import { pinia } from '@/hooks'
10
9
  import { useConfigStore } from '@/stores/config'
11
10
  import { useSvgEditLayoutStore } from '@/stores/svg-edit-layout'
12
11
  import { kebabCase } from 'lodash-es'
12
+ import { vueComp } from '@/config'
13
+
14
+ export const stopEvent = (e: any) => {
15
+ e.stopPropagation()
16
+ }
17
+ export const preventDefault = (e: any) => {
18
+ e.preventDefault()
19
+ }
20
+
21
+ export function componentsRegister() {
22
+ //注册所有组件
23
+ const instance = getCurrentInstance()
24
+ for (let key in vueComp) {
25
+ if (!instance?.appContext?.components.hasOwnProperty(key) && vueComp.hasOwnProperty(key)) {
26
+ instance?.appContext?.app.component(key, vueComp[key])
27
+ }
28
+ }
29
+ }
13
30
 
14
31
  /**
15
32
  * 生成随机字符串
@@ -471,7 +488,7 @@ export const createLine = (e: MouseEvent, type?: ELineBindAnchors, itemInfo?: ID
471
488
  )
472
489
  }
473
490
  const done_item_json = {
474
- id: straight_line_system.name + randomString(),
491
+ id: randomString(),
475
492
  x: x,
476
493
  y: y,
477
494
  client: {