diff --git a/build/plugin/unplugin.js b/build/plugin/unplugin.js index a433941..ab77e79 100644 --- a/build/plugin/unplugin.js +++ b/build/plugin/unplugin.js @@ -1,3 +1,4 @@ +import AutoImport from 'unplugin-auto-import/vite' import Components from 'unplugin-vue-components/vite' import { NaiveUiResolver } from 'unplugin-vue-components/resolvers' import { FileSystemIconLoader } from 'unplugin-icons/loaders' @@ -14,6 +15,9 @@ import { getRootPath } from '../utils' const customIconPath = getRootPath('src', 'assets/icons') export default [ + AutoImport({ + imports: ['vue', 'vue-router'], + }), Icons({ compiler: 'vue3', customCollections: { diff --git a/package.json b/package.json index 3b991d4..2f67e13 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "rollup-plugin-visualizer": "^5.6.0", "sass": "^1.49.10", "unocss": "^0.38.2", + "unplugin-auto-import": "^0.8.8", "unplugin-icons": "^0.14.1", "unplugin-vue-components": "^0.17.21", "vite": "^2.9.9", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fd0eef5..445c095 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -24,6 +24,7 @@ specifiers: rollup-plugin-visualizer: ^5.6.0 sass: ^1.49.10 unocss: ^0.38.2 + unplugin-auto-import: ^0.8.8 unplugin-icons: ^0.14.1 unplugin-vue-components: ^0.17.21 vite: ^2.9.9 @@ -61,6 +62,7 @@ devDependencies: rollup-plugin-visualizer: 5.6.0 sass: 1.49.10 unocss: 0.38.2_vite@2.9.9 + unplugin-auto-import: 0.8.8_y44jlmyuqbnkfkqeyjo67naj6e unplugin-icons: 0.14.1_jyihscimozjyoh3ugo77i7phoi unplugin-vue-components: 0.17.21_vite@2.9.9+vue@3.2.31 vite: 2.9.9_sass@1.49.10 @@ -563,6 +565,12 @@ packages: hasBin: true dev: true + /acorn/8.7.1: + resolution: {integrity: sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==} + engines: {node: '>=0.4.0'} + hasBin: true + dev: true + /ajv/6.12.6: resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} dependencies: @@ -1208,6 +1216,11 @@ packages: engines: {node: '>=10'} dev: true + /escape-string-regexp/5.0.0: + resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} + engines: {node: '>=12'} + dev: true + /eslint-config-prettier/8.5.0_eslint@8.12.0: resolution: {integrity: sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==} hasBin: true @@ -1773,6 +1786,10 @@ packages: resolution: {integrity: sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=} dev: true + /jsonc-parser/3.0.0: + resolution: {integrity: sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==} + dev: true + /jsonfile/6.1.0: resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} dependencies: @@ -1890,6 +1907,17 @@ packages: brace-expansion: 2.0.1 dev: true + /mlly/0.3.19: + resolution: {integrity: sha512-zMq5n3cOf4fOzA4WoeulxagbAgMChdev3MgP6K51k7M0u2whTXxupfIY4VVzws4vxkiWhwH1rVQcsw7zDGfRhA==} + dev: true + + /mlly/0.5.3: + resolution: {integrity: sha512-im69tuLD9EJh9fc9TZRpJEFvsBcGMez7glUCWDcHWWCKzhvPmNvyaYjp/+h0qJJN/Xovrs//GzGjOOKmFw4Gog==} + dependencies: + pathe: 0.2.0 + pkg-types: 0.3.2 + dev: true + /mockjs/1.1.0: resolution: {integrity: sha512-eQsKcWzIaZzEZ07NuEyO4Nw65g0hdWAyurVol1IPl1gahRwY+svqzfgfey8U8dahLwG44d6/RwEzuK52rSa/JQ==} hasBin: true @@ -2136,6 +2164,14 @@ packages: vue-demi: 0.12.5_vue@3.2.31 dev: false + /pkg-types/0.3.2: + resolution: {integrity: sha512-eBYzX/7NYsQEOR2alWY4rnQB49G62oHzFpoi9Som56aUr8vB8UGcmcIia9v8fpBeuhH3Ltentuk2OGpp4IQV3Q==} + dependencies: + jsonc-parser: 3.0.0 + mlly: 0.3.19 + pathe: 0.2.0 + dev: true + /postcss/8.4.12: resolution: {integrity: sha512-lg6eITwYe9v6Hr5CncVbK70SoioNQIq81nsaG86ev5hAidQvmOeETBqs7jm43K2F5/Ley3ytDtriImV6TpNiSg==} engines: {node: ^10 || ^12 || >=14} @@ -2278,6 +2314,10 @@ packages: source-map-js: 1.0.2 dev: true + /scule/0.2.1: + resolution: {integrity: sha512-M9gnWtn3J0W+UhJOHmBxBTwv8mZCan5i1Himp60t6vvZcor0wr+IM0URKmIglsWJ7bRujNAVVN77fp+uZaWoKg==} + dev: true + /seemly/0.3.4: resolution: {integrity: sha512-/crL+UfbtYd6NdLdnf58xaABfeSRt5uKE4N1SFQAW7nIznOrJQchAaslJHxV8/iAfV0LWInrmxJBFdDb0c2/sw==} dependencies: @@ -2378,6 +2418,12 @@ packages: engines: {node: '>=8'} dev: true + /strip-literal/0.4.0: + resolution: {integrity: sha512-ql/sBDoJOybTKSIOWrrh8kgUEMjXMwRAkZTD0EwiwxQH/6tTPkZvMIEjp0CRlpi6V5FMiJyvxeRkEi1KrGISoA==} + dependencies: + acorn: 8.7.1 + dev: true + /supports-color/7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} @@ -2460,6 +2506,26 @@ packages: engines: {node: '>=12.18'} dev: true + /unimport/0.2.9_vite@2.9.9: + resolution: {integrity: sha512-5SLmZZL2rwaNOQa/yTGaG0QI0meRhb6MDdIlS9s1uHPSYO6Gfzr7ugl5Rf35/CJioW6wYiNJsN9dru5JMzaD8w==} + dependencies: + '@rollup/pluginutils': 4.2.1 + escape-string-regexp: 5.0.0 + fast-glob: 3.2.11 + local-pkg: 0.4.1 + magic-string: 0.26.2 + mlly: 0.5.3 + pathe: 0.3.0 + scule: 0.2.1 + strip-literal: 0.4.0 + unplugin: 0.7.0_vite@2.9.9 + transitivePeerDependencies: + - esbuild + - rollup + - vite + - webpack + dev: true + /universalify/2.0.0: resolution: {integrity: sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==} engines: {node: '>= 10.0.0'} @@ -2499,6 +2565,29 @@ packages: engines: {node: '>= 0.8'} dev: true + /unplugin-auto-import/0.8.8_y44jlmyuqbnkfkqeyjo67naj6e: + resolution: {integrity: sha512-cVZ79zMR1v4VCZ9emFTUnltmazCc2B4hObyVrxJdlgJ2sK8qub6JfjFt38rCF6MVEddkHiWCU6wZR1qbdqe+ig==} + engines: {node: '>=14'} + peerDependencies: + '@vueuse/core': '*' + peerDependenciesMeta: + '@vueuse/core': + optional: true + dependencies: + '@antfu/utils': 0.5.2 + '@rollup/pluginutils': 4.2.1 + '@vueuse/core': 8.4.2_vue@3.2.31 + local-pkg: 0.4.1 + magic-string: 0.26.2 + unimport: 0.2.9_vite@2.9.9 + unplugin: 0.7.0_vite@2.9.9 + transitivePeerDependencies: + - esbuild + - rollup + - vite + - webpack + dev: true + /unplugin-icons/0.14.1_jyihscimozjyoh3ugo77i7phoi: resolution: {integrity: sha512-drZFbMctvT3ZJPfdCgBv5+LKO8hGbZApRCoBRAUhQFRJQVNGUhGThrOKs+CvWq3XDBPptGNBmst8WyObbr4xiQ==} peerDependencies: @@ -2608,6 +2697,30 @@ packages: webpack-virtual-modules: 0.4.3 dev: true + /unplugin/0.7.0_vite@2.9.9: + resolution: {integrity: sha512-OsiFrgybmqm5bGuaodvbLYhqUrvGuRHRMZDhddKEXTDbuQ1x+hR7M1WpQguXj03whVYjEYChhFo738cZH5RNig==} + peerDependencies: + esbuild: '>=0.13' + rollup: ^2.50.0 + vite: ^2.3.0 + webpack: 4 || 5 + peerDependenciesMeta: + esbuild: + optional: true + rollup: + optional: true + vite: + optional: true + webpack: + optional: true + dependencies: + acorn: 8.7.1 + chokidar: 3.5.3 + vite: 2.9.9_sass@1.49.10 + webpack-sources: 3.2.3 + webpack-virtual-modules: 0.4.3 + dev: true + /uri-js/4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} dependencies: diff --git a/src/components/AppProvider/index.vue b/src/components/AppProvider/index.vue index a708769..85a2872 100644 --- a/src/components/AppProvider/index.vue +++ b/src/components/AppProvider/index.vue @@ -17,7 +17,6 @@ diff --git a/src/views/examples/table/post/PostCreate.vue b/src/views/examples/table/post/PostCreate.vue index d550343..4777b0c 100644 --- a/src/views/examples/table/post/PostCreate.vue +++ b/src/views/examples/table/post/PostCreate.vue @@ -9,9 +9,6 @@