Commit 45160e14 authored by wangjiankun's avatar wangjiankun

feat: auto-import

parent 1d34a98e
......@@ -7,6 +7,7 @@ module.exports = {
extends: [
'plugin:vue/essential',
'airbnb-base',
'eslintrc-auto-import.json',
],
globals: {
youngDanStorage: 'writable',
......
......@@ -4,6 +4,12 @@
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@antfu/utils": {
"version": "0.5.0",
"resolved": "https://registry.npmmirror.com/@antfu/utils/-/utils-0.5.0.tgz",
"integrity": "sha512-MrAQ/MrPSxbh1bBrmwJjORfJymw4IqSHFBXqvxaga3ZdDM+/zokYF8DjyJpSjY2QmpmgQrajDUBJOWrYeARfzA==",
"dev": true
},
"@babel/helper-validator-identifier": {
"version": "7.15.7",
"resolved": "https://registry.nlark.com/@babel/helper-validator-identifier/download/@babel/helper-validator-identifier-7.15.7.tgz?cache=0&sync_timestamp=1631921299259&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40babel%2Fhelper-validator-identifier%2Fdownload%2F%40babel%2Fhelper-validator-identifier-7.15.7.tgz",
......@@ -1913,6 +1919,12 @@
"resolved": "https://registry.nlark.com/lib-flexible/download/lib-flexible-0.3.2.tgz",
"integrity": "sha1-BvWnSDIxSi01wSA5vJw8otrqpCY="
},
"local-pkg": {
"version": "0.4.1",
"resolved": "https://registry.npmmirror.com/local-pkg/-/local-pkg-0.4.1.tgz",
"integrity": "sha512-lL87ytIGP2FU5PWwNDo0w3WhIo2gopIAxPg9RxDYF7m4rr5ahuZxP22xnJHIvaLTe4Z9P6uKKY2UHiwyB4pcrw==",
"dev": true
},
"locate-path": {
"version": "2.0.0",
"resolved": "https://registry.nlark.com/locate-path/download/locate-path-2.0.0.tgz",
......@@ -2596,6 +2608,12 @@
"has-flag": "^4.0.0"
}
},
"supports-preserve-symlinks-flag": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
"integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==",
"dev": true
},
"text-table": {
"version": "0.2.0",
"resolved": "https://registry.nlark.com/text-table/download/text-table-0.2.0.tgz",
......@@ -2694,6 +2712,89 @@
"resolved": "https://registry.nlark.com/universalify/download/universalify-2.0.0.tgz",
"integrity": "sha1-daSYTv7cSwiXXFrrc/Uw0C3yVxc="
},
"unplugin": {
"version": "0.4.0",
"resolved": "https://registry.npmmirror.com/unplugin/-/unplugin-0.4.0.tgz",
"integrity": "sha512-4ScITEmzlz1iZW3tkz+3L1V5k/xMQ6kjgm4lEXKxH0ozd8/OUWfiSA7RMRyrawsvq/t50JIzPpp1UyuSL/AXkA==",
"dev": true,
"requires": {
"chokidar": "^3.5.3",
"webpack-virtual-modules": "^0.4.3"
},
"dependencies": {
"chokidar": {
"version": "3.5.3",
"resolved": "https://registry.npmmirror.com/chokidar/-/chokidar-3.5.3.tgz",
"integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==",
"dev": true,
"requires": {
"anymatch": "~3.1.2",
"braces": "~3.0.2",
"fsevents": "~2.3.2",
"glob-parent": "~5.1.2",
"is-binary-path": "~2.1.0",
"is-glob": "~4.0.1",
"normalize-path": "~3.0.0",
"readdirp": "~3.6.0"
}
}
}
},
"unplugin-auto-import": {
"version": "0.6.9",
"resolved": "https://registry.npmmirror.com/unplugin-auto-import/-/unplugin-auto-import-0.6.9.tgz",
"integrity": "sha512-IqgT7AoRrNQwNhiF/wDH3sMEDX8SqCYBEgJzwdg5441b5aiC5VwZz0J0wYqkaKu89YkZE9DG6rQ2JpFfZv1iiQ==",
"dev": true,
"requires": {
"@antfu/utils": "^0.5.0",
"@rollup/pluginutils": "^4.2.0",
"local-pkg": "^0.4.1",
"magic-string": "^0.26.1",
"resolve": "^1.22.0",
"unplugin": "^0.4.0"
},
"dependencies": {
"@rollup/pluginutils": {
"version": "4.2.0",
"resolved": "https://registry.npmmirror.com/@rollup/pluginutils/-/pluginutils-4.2.0.tgz",
"integrity": "sha512-2WUyJNRkyH5p487pGnn4tWAsxhEFKN/pT8CMgHshd5H+IXkOnKvKZwsz5ZWz+YCXkleZRAU5kwbfgF8CPfDRqA==",
"dev": true,
"requires": {
"estree-walker": "^2.0.1",
"picomatch": "^2.2.2"
}
},
"is-core-module": {
"version": "2.8.1",
"resolved": "https://registry.npmmirror.com/is-core-module/-/is-core-module-2.8.1.tgz",
"integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==",
"dev": true,
"requires": {
"has": "^1.0.3"
}
},
"magic-string": {
"version": "0.26.1",
"resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.26.1.tgz",
"integrity": "sha512-ndThHmvgtieXe8J/VGPjG+Apu7v7ItcD5mhEIvOscWjPF/ccOiLxHaSuCAS2G+3x4GKsAbT8u7zdyamupui8Tg==",
"dev": true,
"requires": {
"sourcemap-codec": "^1.4.8"
}
},
"resolve": {
"version": "1.22.0",
"resolved": "https://registry.npmmirror.com/resolve/-/resolve-1.22.0.tgz",
"integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==",
"dev": true,
"requires": {
"is-core-module": "^2.8.1",
"path-parse": "^1.0.7",
"supports-preserve-symlinks-flag": "^1.0.0"
}
}
}
},
"upath": {
"version": "2.0.1",
"resolved": "https://registry.nlark.com/upath/download/upath-2.0.1.tgz",
......@@ -3035,6 +3136,12 @@
"@vue/devtools-api": "^6.0.0-beta.11"
}
},
"webpack-virtual-modules": {
"version": "0.4.3",
"resolved": "https://registry.npmmirror.com/webpack-virtual-modules/-/webpack-virtual-modules-0.4.3.tgz",
"integrity": "sha512-5NUqC2JquIL2pBAAo/VfBP6KuGkHIZQXW/lNKupLPfhViwh8wNsu0BObtl09yuKZszeEUfbXz8xhrHvSG16Nqw==",
"dev": true
},
"which": {
"version": "2.0.2",
"resolved": "https://registry.npm.taobao.org/which/download/which-2.0.2.tgz",
......
// Generated by 'unplugin-auto-import'
// We suggest you to commit this file into source control
declare global {
const computed: typeof import('vue')['computed']
const createApp: typeof import('vue')['createApp']
const customRef: typeof import('vue')['customRef']
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
const defineComponent: typeof import('vue')['defineComponent']
const effectScope: typeof import('vue')['effectScope']
const EffectScope: typeof import('vue')['EffectScope']
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
const getCurrentScope: typeof import('vue')['getCurrentScope']
const h: typeof import('vue')['h']
const inject: typeof import('vue')['inject']
const isReadonly: typeof import('vue')['isReadonly']
const isRef: typeof import('vue')['isRef']
const markRaw: typeof import('vue')['markRaw']
const nextTick: typeof import('vue')['nextTick']
const onActivated: typeof import('vue')['onActivated']
const onBeforeMount: typeof import('vue')['onBeforeMount']
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
const onDeactivated: typeof import('vue')['onDeactivated']
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
const onMounted: typeof import('vue')['onMounted']
const onRenderTracked: typeof import('vue')['onRenderTracked']
const onRenderTriggered: typeof import('vue')['onRenderTriggered']
const onScopeDispose: typeof import('vue')['onScopeDispose']
const onServerPrefetch: typeof import('vue')['onServerPrefetch']
const onUnmounted: typeof import('vue')['onUnmounted']
const onUpdated: typeof import('vue')['onUpdated']
const provide: typeof import('vue')['provide']
const reactive: typeof import('vue')['reactive']
const readonly: typeof import('vue')['readonly']
const ref: typeof import('vue')['ref']
const resolveComponent: typeof import('vue')['resolveComponent']
const shallowReactive: typeof import('vue')['shallowReactive']
const shallowReadonly: typeof import('vue')['shallowReadonly']
const shallowRef: typeof import('vue')['shallowRef']
const toRaw: typeof import('vue')['toRaw']
const toRef: typeof import('vue')['toRef']
const toRefs: typeof import('vue')['toRefs']
const triggerRef: typeof import('vue')['triggerRef']
const unref: typeof import('vue')['unref']
const useAttrs: typeof import('vue')['useAttrs']
const useCssModule: typeof import('vue')['useCssModule']
const useCssVars: typeof import('vue')['useCssVars']
const useRoute: typeof import('vue-router')['useRoute']
const useRouter: typeof import('vue-router')['useRouter']
const useSlots: typeof import('vue')['useSlots']
const watch: typeof import('vue')['watch']
const watchEffect: typeof import('vue')['watchEffect']
}
export {}
......@@ -29,7 +29,6 @@
<script lang="ts" setup>
import { Button, Dialog } from 'vant';
import { ref, onMounted } from 'vue';
import {
GetUserDetail, GetDepts, GetDeptUser, SendMessage, GetUserInfo,
} from '@/api/auth';
......
......@@ -8,7 +8,6 @@
<script lang="ts" setup>
import { Button } from 'vant';
import { useRouter } from 'vue-router';
const router = useRouter();
const BackHome = () => {
......
......@@ -3,6 +3,7 @@ import { resolve } from 'path';
import vue from '@vitejs/plugin-vue';
import viteCompression from 'vite-plugin-compression';
import styleImport from 'vite-plugin-style-import';
import autoImport from 'unplugin-auto-import/vite'
// https://vitejs.dev/config/
const buildTimeStep = new Date().getTime()
......@@ -15,6 +16,10 @@ export default defineConfig({
deleteOriginFile: false, // 打包完成后删除源文件
}),
styleImport({}),
autoImport({
imports: ['vue', 'vue-router'],
dts: './src/auto-import.d.ts',
})
],
resolve: {
alias: {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment