@zhangqingcq/vgce 0.0.17 → 0.0.19
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +85 -83
- package/dist/style.css +2 -2
- package/dist/vgce.js +6979 -6928
- package/dist/vgce.umd.cjs +62 -62
- package/package.json +12 -10
- package/src/App.vue +1 -3
- package/src/components/svg-analysis/index.vue +0 -2
- package/src/components/svg-editor/center-panel/index.vue +0 -1
- package/src/components/svg-editor/component-tree/index.vue +0 -1
- package/src/components/svg-editor/connection-panel/index.vue +0 -1
- package/src/components/svg-editor/export-json/index.vue +0 -1
- package/src/components/svg-editor/handle-panel/index.vue +0 -1
- package/src/components/svg-editor/import-json/index.vue +0 -1
- package/src/components/svg-editor/index.vue +0 -1
- package/src/components/svg-editor/left-panel/index.vue +0 -1
- package/src/components/svg-editor/right-panel/code-edit-modal.vue +0 -1
- package/src/components/svg-editor/right-panel/common-animate.vue +0 -1
- package/src/components/svg-editor/right-panel/condition.vue +0 -1
- package/src/components/svg-editor/right-panel/dynamic-el-form-item.vue +4 -4
- package/src/components/svg-editor/right-panel/index.vue +1 -2
- package/src/components/svg-editor/right-panel/list.vue +0 -1
- package/src/components/svg-viewer/index.vue +14 -2
- package/src/components/vue3-ruler-tool/index.vue +0 -1
- package/src/config/files/clock-a.vue +0 -2
- package/src/config/files/common-table.vue +0 -1
- package/src/config/files/light-a.vue +0 -2
- package/src/config/files/now-time.vue +0 -1
- package/src/config/files/pie-charts.vue +0 -1
- package/src/config/files/progress.vue +0 -1
- package/src/config/files/svg-text.vue +0 -2
- package/src/config/files/switch-a.vue +0 -2
- package/src/config/svg/stateless/index.ts +1 -5
- package/src/config/types.ts +2 -2
- package/src/hooks.ts +0 -1
- package/src/index.ts +2 -4
- package/src/main.ts +0 -1
- package/src/stores/config/index.ts +0 -1
- package/src/stores/global/index.ts +0 -2
- package/src/stores/main.ts +0 -3
- package/src/stores/svg-edit-layout/index.ts +0 -1
- package/src/stores/system/index.ts +0 -1
- package/src/utils/fetch.ts +2 -4
- package/src/utils/proxy.ts +0 -1
- package/src/views/EditorS.vue +0 -1
- package/types/index.d.ts +21 -3
package/README.md
CHANGED
@@ -1,83 +1,85 @@
|
|
1
|
-
# VGCE
|
2
|
-
|
3
|
-
Vector graphics configure editor. 矢量图组态编辑器。
|
4
|
-
|
5
|
-
## Guide
|
6
|
-
|
7
|
-
1. `npm i @zhangqingcq/vgce` or `pnpm add @zhangqingcq/vgce`
|
8
|
-
|
9
|
-
2. `import '@zhangqingcq/vgce/style'` in main.ts
|
10
|
-
|
11
|
-
3. editor
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
<
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
<
|
30
|
-
|
31
|
-
</
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
*
|
39
|
-
|
40
|
-
*
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
<
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
*
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
import {
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
6. example
|
81
|
-
* download [VGCE](https://github.com/RickyHeaven/VGCE.git)
|
82
|
-
|
83
|
-
* `pnpm
|
1
|
+
# VGCE
|
2
|
+
|
3
|
+
Vector graphics configure editor. 矢量图组态编辑器。
|
4
|
+
|
5
|
+
## Guide
|
6
|
+
|
7
|
+
1. `npm i @zhangqingcq/vgce` or `pnpm add @zhangqingcq/vgce`
|
8
|
+
|
9
|
+
2. `import '@zhangqingcq/vgce/style'` in main.ts
|
10
|
+
|
11
|
+
3. editor
|
12
|
+
```
|
13
|
+
<script setup lang="ts">
|
14
|
+
import {SvgEditor} from '@zhangqingcq/vgce'
|
15
|
+
|
16
|
+
function preview(d: any) {
|
17
|
+
//save d and send it to SvgViewer's data
|
18
|
+
}
|
19
|
+
</script>
|
20
|
+
<template>
|
21
|
+
<SvgEditor @onPreview="preview"/>
|
22
|
+
</template>
|
23
|
+
```
|
24
|
+
4. viewer
|
25
|
+
```
|
26
|
+
<script setup lang="ts">
|
27
|
+
import {SvgViewer} from '@zhangqingcq/vgce'
|
28
|
+
</script>
|
29
|
+
<template>
|
30
|
+
<SvgViewer :data="xxx"/>
|
31
|
+
</template>
|
32
|
+
```
|
33
|
+
5. custom toolbar
|
34
|
+
* copy `src/config/` and change as you want
|
35
|
+
|
36
|
+
* put svg files into `src/asset/svgs` , then file name need to be same with config.name
|
37
|
+
|
38
|
+
* put custom parts file into `src/config/files`, then import in `src/config/index.ts` and export with `vueComp`
|
39
|
+
|
40
|
+
* PS: you have to install `vite-plugin-svg-icons` plugin to append your svgs to html dom.
|
41
|
+
```
|
42
|
+
<script setup lang="ts">
|
43
|
+
import {SvgEditor} from '@zhangqingcq/vgce'
|
44
|
+
import {config} from '@/config'
|
45
|
+
</script>
|
46
|
+
<template>
|
47
|
+
<SvgEditor :customToolbar="config"/>
|
48
|
+
</template>
|
49
|
+
```
|
50
|
+
5.1 how to use `vite-plugin-svg-icons`
|
51
|
+
* `npm i vite-plugin-svg-icons -D` or `pnpm add vite-plugin-svg-icons -D`
|
52
|
+
|
53
|
+
* change `vite.config.ts`
|
54
|
+
```
|
55
|
+
// vite.config.ts
|
56
|
+
|
57
|
+
import { fileURLToPath, URL } from 'node:url'
|
58
|
+
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
|
59
|
+
|
60
|
+
export default defineConfig({
|
61
|
+
plugins: [
|
62
|
+
xxx,
|
63
|
+
createSvgIconsPlugin({
|
64
|
+
iconDirs: [fileURLToPath(new URL('./src/assets/svgs', import.meta.url))],
|
65
|
+
symbolId: 'svg-[name]',
|
66
|
+
svgoOptions: false,
|
67
|
+
customDomId: '__svg__icons__dom__'//your id, do not use this id!
|
68
|
+
})
|
69
|
+
],
|
70
|
+
xxx
|
71
|
+
})
|
72
|
+
```
|
73
|
+
* change `main.ts`
|
74
|
+
```
|
75
|
+
// main.ts
|
76
|
+
|
77
|
+
import 'virtual:svg-icons-register'
|
78
|
+
```
|
79
|
+
* PS: if there is error: `Cannot find module ‘fast-glob’`,then run `npm i fast-glob -D` or `pnpm add fast-glob -D`
|
80
|
+
6. example
|
81
|
+
* download [VGCE](https://github.com/RickyHeaven/VGCE.git)
|
82
|
+
|
83
|
+
* `pnpm i` or `npm i`
|
84
|
+
|
85
|
+
* `pnpm dev` or `npm run dev`
|