⚡️性能(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',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'plugin:vue/vue3-essential',
|
||||
'plugin:prettier/recommended'
|
||||
'plugin:prettier/recommended',
|
||||
'vue-global-api'
|
||||
],
|
||||
overrides: [
|
||||
{
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import request from '@/utils/axios/request'
|
||||
|
||||
// 演示代码
|
||||
export const postLogin = (params: any) => {
|
||||
return request.post('/user/login', params);
|
||||
export const postLogin = (params: object) => {
|
||||
return request.post('/user/login', params)
|
||||
}
|
||||
|
@@ -1,6 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { ECharts, EChartsOption, init } from 'echarts'
|
||||
import { ref, watch, onMounted, onBeforeUnmount } from 'vue'
|
||||
|
||||
// 定义props
|
||||
interface Props {
|
||||
|
@@ -2,6 +2,7 @@ import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
|
||||
// 引入 nprogress 相关方法
|
||||
import { close, start } from '@/utils/nprogress/nprogress'
|
||||
import login from './modules/login'
|
||||
|
||||
const routes: Array<RouteRecordRaw> = [...login]
|
||||
|
||||
const router = createRouter({
|
||||
|
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"noImplicitAny": false,
|
||||
"typeRoots": [
|
||||
"node_modules/@types",
|
||||
"src/types",
|
||||
@@ -39,7 +40,8 @@
|
||||
"include": [
|
||||
"src/**/*.ts",
|
||||
"src/**/*.tsx",
|
||||
"src/**/*.vue"
|
||||
"src/**/*.vue",
|
||||
"auto-import.d.ts"
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
|
@@ -15,11 +15,9 @@ import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
|
||||
|
||||
import autoprefixer from 'autoprefixer'
|
||||
|
||||
|
||||
import viteCompression from 'vite-plugin-compression'
|
||||
import viteImagemin from 'vite-plugin-imagemin'
|
||||
|
||||
|
||||
export default defineConfig(({ mode, command }) => {
|
||||
const env = loadEnv(mode, process.cwd())
|
||||
return {
|
||||
@@ -99,9 +97,15 @@ export default defineConfig(({ mode, command }) => {
|
||||
imports: ['vue', 'vue-router'],
|
||||
dts: 'auto-import.d.ts',
|
||||
//ant-design-vue
|
||||
resolvers: [AntDesignVueResolver()]
|
||||
resolvers: [AntDesignVueResolver()],
|
||||
eslintrc: {
|
||||
enabled: false // 1、改为true用于生成eslint配置。2、生成后改回false,避免重复生成消耗
|
||||
|
||||
}
|
||||
}),
|
||||
Components({
|
||||
// 指定自动导入的组件位置,默认是 src/components
|
||||
dirs: ['src/components'],
|
||||
//ant-design-vue
|
||||
resolvers: [AntDesignVueResolver({ importStyle: true, resolveIcons: true })]
|
||||
})
|
||||
@@ -163,5 +167,4 @@ export default defineConfig(({ mode, command }) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
|
Reference in New Issue
Block a user