⚡️性能(deps): add auto-import
This commit is contained in:
72
.eslintrc-auto-import.json
Normal file
72
.eslintrc-auto-import.json
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
{
|
||||||
|
"globals": {
|
||||||
|
"Component": true,
|
||||||
|
"ComponentPublicInstance": true,
|
||||||
|
"ComputedRef": true,
|
||||||
|
"EffectScope": true,
|
||||||
|
"ExtractDefaultPropTypes": true,
|
||||||
|
"ExtractPropTypes": true,
|
||||||
|
"ExtractPublicPropTypes": true,
|
||||||
|
"InjectionKey": true,
|
||||||
|
"PropType": true,
|
||||||
|
"Ref": true,
|
||||||
|
"VNode": true,
|
||||||
|
"WritableComputedRef": true,
|
||||||
|
"computed": true,
|
||||||
|
"createApp": true,
|
||||||
|
"customRef": true,
|
||||||
|
"defineAsyncComponent": true,
|
||||||
|
"defineComponent": true,
|
||||||
|
"effectScope": true,
|
||||||
|
"getCurrentInstance": true,
|
||||||
|
"getCurrentScope": true,
|
||||||
|
"h": true,
|
||||||
|
"inject": true,
|
||||||
|
"isProxy": true,
|
||||||
|
"isReactive": true,
|
||||||
|
"isReadonly": true,
|
||||||
|
"isRef": true,
|
||||||
|
"markRaw": true,
|
||||||
|
"nextTick": true,
|
||||||
|
"onActivated": true,
|
||||||
|
"onBeforeMount": true,
|
||||||
|
"onBeforeRouteLeave": true,
|
||||||
|
"onBeforeRouteUpdate": true,
|
||||||
|
"onBeforeUnmount": true,
|
||||||
|
"onBeforeUpdate": true,
|
||||||
|
"onDeactivated": true,
|
||||||
|
"onErrorCaptured": true,
|
||||||
|
"onMounted": true,
|
||||||
|
"onRenderTracked": true,
|
||||||
|
"onRenderTriggered": true,
|
||||||
|
"onScopeDispose": true,
|
||||||
|
"onServerPrefetch": true,
|
||||||
|
"onUnmounted": true,
|
||||||
|
"onUpdated": true,
|
||||||
|
"provide": true,
|
||||||
|
"reactive": true,
|
||||||
|
"readonly": true,
|
||||||
|
"ref": true,
|
||||||
|
"resolveComponent": true,
|
||||||
|
"shallowReactive": true,
|
||||||
|
"shallowReadonly": true,
|
||||||
|
"shallowRef": true,
|
||||||
|
"toRaw": true,
|
||||||
|
"toRef": true,
|
||||||
|
"toRefs": true,
|
||||||
|
"toValue": true,
|
||||||
|
"triggerRef": true,
|
||||||
|
"unref": true,
|
||||||
|
"useAttrs": true,
|
||||||
|
"useCssModule": true,
|
||||||
|
"useCssVars": true,
|
||||||
|
"useLink": true,
|
||||||
|
"useRoute": true,
|
||||||
|
"useRouter": true,
|
||||||
|
"useSlots": true,
|
||||||
|
"watch": true,
|
||||||
|
"watchEffect": true,
|
||||||
|
"watchPostEffect": true,
|
||||||
|
"watchSyncEffect": true
|
||||||
|
}
|
||||||
|
}
|
@@ -8,7 +8,8 @@ module.exports = {
|
|||||||
'eslint:recommended',
|
'eslint:recommended',
|
||||||
'plugin:@typescript-eslint/recommended',
|
'plugin:@typescript-eslint/recommended',
|
||||||
'plugin:vue/vue3-essential',
|
'plugin:vue/vue3-essential',
|
||||||
'plugin:prettier/recommended'
|
'plugin:prettier/recommended',
|
||||||
|
'vue-global-api'
|
||||||
],
|
],
|
||||||
overrides: [
|
overrides: [
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import request from '@/utils/axios/request'
|
import request from '@/utils/axios/request'
|
||||||
|
|
||||||
// 演示代码
|
// 演示代码
|
||||||
export const postLogin = (params: any) => {
|
export const postLogin = (params: object) => {
|
||||||
return request.post('/user/login', params);
|
return request.post('/user/login', params)
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ECharts, EChartsOption, init } from 'echarts'
|
import { ECharts, EChartsOption, init } from 'echarts'
|
||||||
import { ref, watch, onMounted, onBeforeUnmount } from 'vue'
|
|
||||||
|
|
||||||
// 定义props
|
// 定义props
|
||||||
interface Props {
|
interface Props {
|
||||||
|
@@ -2,6 +2,7 @@ import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
|
|||||||
// 引入 nprogress 相关方法
|
// 引入 nprogress 相关方法
|
||||||
import { close, start } from '@/utils/nprogress/nprogress'
|
import { close, start } from '@/utils/nprogress/nprogress'
|
||||||
import login from './modules/login'
|
import login from './modules/login'
|
||||||
|
|
||||||
const routes: Array<RouteRecordRaw> = [...login]
|
const routes: Array<RouteRecordRaw> = [...login]
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noImplicitAny": false,
|
||||||
"typeRoots": [
|
"typeRoots": [
|
||||||
"node_modules/@types",
|
"node_modules/@types",
|
||||||
"src/types",
|
"src/types",
|
||||||
@@ -39,7 +40,8 @@
|
|||||||
"include": [
|
"include": [
|
||||||
"src/**/*.ts",
|
"src/**/*.ts",
|
||||||
"src/**/*.tsx",
|
"src/**/*.tsx",
|
||||||
"src/**/*.vue"
|
"src/**/*.vue",
|
||||||
|
"auto-import.d.ts"
|
||||||
],
|
],
|
||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
|
@@ -15,11 +15,9 @@ import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
|
|||||||
|
|
||||||
import autoprefixer from 'autoprefixer'
|
import autoprefixer from 'autoprefixer'
|
||||||
|
|
||||||
|
|
||||||
import viteCompression from 'vite-plugin-compression'
|
import viteCompression from 'vite-plugin-compression'
|
||||||
import viteImagemin from 'vite-plugin-imagemin'
|
import viteImagemin from 'vite-plugin-imagemin'
|
||||||
|
|
||||||
|
|
||||||
export default defineConfig(({ mode, command }) => {
|
export default defineConfig(({ mode, command }) => {
|
||||||
const env = loadEnv(mode, process.cwd())
|
const env = loadEnv(mode, process.cwd())
|
||||||
return {
|
return {
|
||||||
@@ -99,9 +97,15 @@ export default defineConfig(({ mode, command }) => {
|
|||||||
imports: ['vue', 'vue-router'],
|
imports: ['vue', 'vue-router'],
|
||||||
dts: 'auto-import.d.ts',
|
dts: 'auto-import.d.ts',
|
||||||
//ant-design-vue
|
//ant-design-vue
|
||||||
resolvers: [AntDesignVueResolver()]
|
resolvers: [AntDesignVueResolver()],
|
||||||
|
eslintrc: {
|
||||||
|
enabled: false // 1、改为true用于生成eslint配置。2、生成后改回false,避免重复生成消耗
|
||||||
|
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
Components({
|
Components({
|
||||||
|
// 指定自动导入的组件位置,默认是 src/components
|
||||||
|
dirs: ['src/components'],
|
||||||
//ant-design-vue
|
//ant-design-vue
|
||||||
resolvers: [AntDesignVueResolver({ importStyle: true, resolveIcons: true })]
|
resolvers: [AntDesignVueResolver({ importStyle: true, resolveIcons: true })]
|
||||||
})
|
})
|
||||||
@@ -163,5 +167,4 @@ export default defineConfig(({ mode, command }) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user