瀏覽代碼

chore: 依赖更新到`vue3.3+`以及删除`unplugin-vue-define-options`插件

xiaoxian521 2 年之前
父節點
當前提交
86ec72f3c0
共有 5 個文件被更改,包括 223 次插入242 次删除
  1. 0 2
      build/plugins.ts
  2. 3 4
      package.json
  3. 216 214
      pnpm-lock.yaml
  4. 1 18
      src/views/system/dept/form.vue
  5. 3 4
      tsconfig.json

+ 0 - 2
build/plugins.ts

@@ -10,7 +10,6 @@ import { visualizer } from "rollup-plugin-visualizer";
 import removeConsole from "vite-plugin-remove-console";
 import themePreprocessorPlugin from "@pureadmin/theme";
 import VueI18nPlugin from "@intlify/unplugin-vue-i18n/vite";
-import DefineOptions from "unplugin-vue-define-options/vite";
 import { genScssMultipleScopeVars } from "../src/layout/theme";
 
 export function getPluginsList(
@@ -31,7 +30,6 @@ export function getPluginsList(
     vueJsx(),
     VITE_CDN ? cdn : null,
     configCompressPlugin(VITE_COMPRESSION),
-    DefineOptions(),
     // 线上环境删除console
     removeConsole({ external: ["src/assets/iconfont/iconfont.js"] }),
     viteBuildInfo(),

+ 3 - 4
package.json

@@ -65,7 +65,7 @@
     "swiper": "^9.3.0",
     "typeit": "^8.7.1",
     "v-contextmenu": "3.0.0",
-    "vue": "^3.2.47",
+    "vue": "^3.3.1",
     "vue-i18n": "^9.2.2",
     "vue-json-pretty": "^2.2.4",
     "vue-pdf-embed": "^1.1.6",
@@ -96,7 +96,7 @@
     "@types/sortablejs": "^1.15.1",
     "@typescript-eslint/eslint-plugin": "^5.59.5",
     "@typescript-eslint/parser": "^5.59.5",
-    "@vitejs/plugin-vue": "^4.2.1",
+    "@vitejs/plugin-vue": "^4.2.2",
     "@vitejs/plugin-vue-jsx": "^3.0.1",
     "@vue/eslint-config-prettier": "^7.1.0",
     "@vue/eslint-config-typescript": "^11.0.3",
@@ -134,7 +134,6 @@
     "tailwindcss": "^3.3.2",
     "terser": "^5.17.1",
     "typescript": "^5.0.4",
-    "unplugin-vue-define-options": "1.1.6",
     "vite": "^4.3.5",
     "vite-plugin-cdn-import": "^0.3.5",
     "vite-plugin-compression": "^0.5.1",
@@ -142,7 +141,7 @@
     "vite-plugin-remove-console": "^2.1.1",
     "vite-svg-loader": "^4.0.0",
     "vue-eslint-parser": "^9.2.1",
-    "vue-tsc": "^1.2.0"
+    "vue-tsc": "^1.6.4"
   },
   "pnpm": {
     "peerDependencyRules": {

文件差異過大導致無法顯示
+ 216 - 214
pnpm-lock.yaml


+ 1 - 18
src/views/system/dept/form.vue

@@ -1,27 +1,10 @@
 <script setup lang="ts">
 import { ref } from "vue";
 import { formRules } from "./rule";
+import { FormProps } from "./types";
 import ReCol from "@/components/ReCol";
 import { usePublicHooks } from "../hooks";
 
-/** TODO
- * 针对类型的props/emit声明,vue3.3.0版本以下不支持复杂的类型和从其他文件进行类型导入,等后续vue正式发布3.3.0版本再优化
- * https://cn.vuejs.org/api/sfc-script-setup.html#typescript-only-features
- */
-interface FormProps {
-  formInline: {
-    higherDeptOptions: Record<string, unknown>[];
-    parentId: number;
-    name: string;
-    principal: string;
-    phone: string | number;
-    email: string;
-    sort: number;
-    status: number;
-    remark: string;
-  };
-}
-
 const props = withDefaults(defineProps<FormProps>(), {
   formInline: () => ({
     higherDeptOptions: [],

+ 3 - 4
tsconfig.json

@@ -27,10 +27,9 @@
       "vite/client",
       "element-plus/global",
       "@pureadmin/table/volar",
-      "@pureadmin/descriptions/volar",
-      "unplugin-vue-define-options/macros-global"
+      "@pureadmin/descriptions/volar"
     ],
-    "typeRoots": ["./node_modules/@types/", "./types"]
+    "typeRoots": ["./types", "./node_modules/@types/"]
   },
   "include": [
     "mock/*.ts",
@@ -40,5 +39,5 @@
     "types/*.d.ts",
     "vite.config.ts"
   ],
-  "exclude": ["node_modules", "dist", "**/*.js"]
+  "exclude": ["dist", "**/*.js", "node_modules"]
 }

部分文件因文件數量過多而無法顯示