瀏覽代碼

首次报错问题解决

miaofuhao 8 月之前
父節點
當前提交
5727789d44
共有 3 個文件被更改,包括 30 次插入8 次删除
  1. 8 8
      package.json
  2. 10 0
      vite.config.js
  3. 12 0
      vite/plugins/index.js

+ 8 - 8
package.json

@@ -36,13 +36,13 @@
36 36
     "@logicflow/core": "^1.2.18",
37 37
     "@logicflow/extension": "^1.2.19",
38 38
     "@microsoft/fetch-event-source": "^2.0.1",
39
-    "@tinymce/tinymce-vue": "^5.1.1",
39
+    "@tinymce/tinymce-vue": "^6.1.0",
40 40
     "@traptitech/markdown-it-katex": "^3.6.0",
41 41
     "@types/markdown-it": "^14.1.2",
42 42
     "@vueup/vue-quill": "1.1.0",
43 43
     "@vueuse/core": "9.5.0",
44 44
     "aplayer": "^1.10.1",
45
-    "axios": "0.27.2",
45
+    "axios": "^1.8.4",
46 46
     "better-scroll": "^2.5.1",
47 47
     "bpmn-js": "^13.2.2",
48 48
     "bpmn-js-task-resize": "^1.2.0",
@@ -59,7 +59,7 @@
59 59
     "eslint": "^8.56.0",
60 60
     "file-saver": "2.0.5",
61 61
     "fingerprintjs2": "^2.1.4",
62
-    "form-making": "^1.2.11",
62
+    "form-making": "^0.1.10",
63 63
     "fuse.js": "6.6.2",
64 64
     "getmac": "^6.4.0",
65 65
     "highlight.js": "^10.5.0",
@@ -79,12 +79,12 @@
79 79
     "qrcodejs2-fix": "^0.0.1",
80 80
     "sortablejs": "^1.15.1",
81 81
     "tailwindcss": "3.4.17",
82
-    "tinymce": "^6.8.2",
82
+    "tinymce": "^7.8.0",
83 83
     "vue": "3.2.45",
84 84
     "vue-cropper": "1.0.3",
85 85
     "vue-json-pretty": "^2.4.0",
86 86
     "vue-router": "4.1.4",
87
-    "yarn": "^1.22.19"
87
+    "yarn": "^1.22.22"
88 88
   },
89 89
   "devDependencies": {
90 90
     "@vitejs/plugin-vue": "3.1.0",
@@ -98,10 +98,10 @@
98 98
     "prettier": "^2.8.8",
99 99
     "sass": "1.56.1",
100 100
     "tailwindcss": "^3.4.17",
101
-    "unplugin-auto-import": "0.11.4",
102
-    "vite": "3.2.3",
101
+    "unplugin-auto-import": "^0.11.5",
102
+    "vite": "^3.2.11",
103 103
     "vite-plugin-compression": "0.5.1",
104
-    "vite-plugin-svg-icons": "2.0.1",
104
+    "vite-plugin-svg-icons": "^2.0.1",
105 105
     "vite-plugin-vue-setup-extend": "0.4.0"
106 106
   }
107 107
 }

+ 10 - 0
vite.config.js

@@ -56,3 +56,13 @@ export default defineConfig(({ mode, command }) => {
56 56
     }
57 57
   }
58 58
 })
59
+
60
+// 删除这个函数,因为它应该在 vite/plugins 目录中定义
61
+// function createSvgIcon(viteEnv) {
62
+//   const { createSvgIconsPlugin } = require('vite-plugin-svg-icons')
63
+//   return createSvgIconsPlugin({
64
+//     iconDirs: [path.resolve(process.cwd(), 'src/assets/icons/svg')],
65
+//     symbolId: 'icon-[dir]-[name]',
66
+//     svgoOptions: true
67
+//   })
68
+// }

+ 12 - 0
vite/plugins/index.js

@@ -1,4 +1,7 @@
1 1
 import vue from '@vitejs/plugin-vue'
2
+// 修改导入方式
3
+import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
4
+import path from 'path'
2 5
 
3 6
 import createAutoImport from './auto-import'
4 7
 import createSvgIcon from './svg-icon'
@@ -11,5 +14,14 @@ export default function createVitePlugins(viteEnv, isBuild = false) {
11 14
   vitePlugins.push(createSetupExtend())
12 15
   vitePlugins.push(createSvgIcon(isBuild))
13 16
   isBuild && vitePlugins.push(...createCompression(viteEnv))
17
+  // 修改 SVG 图标插件的使用方式
18
+  vitePlugins.push(
19
+    createSvgIconsPlugin({
20
+      iconDirs: [path.resolve(process.cwd(), 'src/assets/icons/svg')],
21
+      symbolId: 'icon-[dir]-[name]',
22
+      svgoOptions: true
23
+    })
24
+  )
25
+  
14 26
   return vitePlugins
15 27
 }