mirror of
https://github.com/un-pany/v3-admin-vite.git
synced 2025-04-20 10:59:21 +08:00
chore: format 'import type'
This commit is contained in:
parent
26c54ff23e
commit
8c403e0af1
@ -5,7 +5,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<link rel="stylesheet" href="/app-loading.css" />
|
||||
<title>v3-admin-vite</title>
|
||||
<title>V3 Admin Vite</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
|
@ -1,6 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import { useTheme } from "@/hooks/useTheme"
|
||||
import type { ThemeName } from "@/hooks/useTheme"
|
||||
import { type ThemeName, useTheme } from "@/hooks/useTheme"
|
||||
import { MagicStick } from "@element-plus/icons-vue"
|
||||
|
||||
const { themeList, activeThemeName, setTheme } = useTheme()
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { App } from "vue"
|
||||
import { type App } from "vue"
|
||||
import { permission } from "./permission"
|
||||
|
||||
/** 挂载自定义指令 */
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { Directive } from "vue"
|
||||
import { type Directive } from "vue"
|
||||
import { useUserStoreHook } from "@/store/modules/user"
|
||||
|
||||
/** 权限指令 */
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { App } from "vue"
|
||||
import { type App } from "vue"
|
||||
import SvgIcon from "@/components/SvgIcon/index.vue" // Svg Component
|
||||
import "virtual:svg-icons-register"
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref, watch } from "vue"
|
||||
import { useRoute, useRouter } from "vue-router"
|
||||
import type { RouteLocationMatched } from "vue-router"
|
||||
import { type RouteLocationMatched, useRoute, useRouter } from "vue-router"
|
||||
import { compile } from "path-to-regexp"
|
||||
|
||||
const route = useRoute()
|
||||
|
@ -1,7 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed } from "vue"
|
||||
import type { PropType } from "vue"
|
||||
import type { RouteRecordRaw } from "vue-router"
|
||||
import { type PropType, computed } from "vue"
|
||||
import { type RouteRecordRaw } from "vue-router"
|
||||
import SidebarItemLink from "./SidebarItemLink.vue"
|
||||
import { isExternal } from "@/utils/validate"
|
||||
import path from "path-browserify"
|
||||
|
@ -1,9 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { getCurrentInstance, onMounted, ref, watch } from "vue"
|
||||
import { useRoute, useRouter } from "vue-router"
|
||||
import type { RouteRecordRaw } from "vue-router"
|
||||
import { useTagsViewStore } from "@/store/modules/tags-view"
|
||||
import type { ITagView } from "@/store/modules/tags-view"
|
||||
import { type RouteRecordRaw, useRoute, useRouter } from "vue-router"
|
||||
import { type ITagView, useTagsViewStore } from "@/store/modules/tags-view"
|
||||
import { usePermissionStore } from "@/store/modules/permission"
|
||||
import ScrollPane from "./ScrollPane.vue"
|
||||
import path from "path-browserify"
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { App } from "vue"
|
||||
import { type App } from "vue"
|
||||
import * as ElementPlusIconsVue from "@element-plus/icons-vue"
|
||||
|
||||
export function loadElementPlusIcon(app: App) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { App } from "vue"
|
||||
import { type App } from "vue"
|
||||
import ElementPlus from "element-plus"
|
||||
|
||||
export function loadElementPlus(app: App) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { App } from "vue"
|
||||
import { type App } from "vue"
|
||||
import { loadElementPlus } from "./element-pus"
|
||||
import { loadElementPlusIcon } from "./element-pus-icon"
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { createRouter, createWebHashHistory, createWebHistory } from "vue-router"
|
||||
import type { RouteRecordRaw } from "vue-router"
|
||||
import { type RouteRecordRaw, createRouter, createWebHashHistory, createWebHistory } from "vue-router"
|
||||
|
||||
const Layout = () => import("@/layout/index.vue")
|
||||
|
||||
/** 常驻路由 */
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { ref } from "vue"
|
||||
import store from "@/store"
|
||||
import { defineStore } from "pinia"
|
||||
import type { RouteRecordRaw } from "vue-router"
|
||||
import { type RouteRecordRaw } from "vue-router"
|
||||
import { constantRoutes, asyncRoutes } from "@/router"
|
||||
|
||||
const hasPermission = (roles: string[], route: RouteRecordRaw) => {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { ref } from "vue"
|
||||
import { defineStore } from "pinia"
|
||||
import type { RouteLocationNormalized } from "vue-router"
|
||||
import { type RouteLocationNormalized } from "vue-router"
|
||||
|
||||
export type ITagView = Partial<RouteLocationNormalized>
|
||||
|
||||
|
@ -4,9 +4,8 @@ import { defineStore } from "pinia"
|
||||
import { usePermissionStore } from "./permission"
|
||||
import { getToken, removeToken, setToken } from "@/utils/cache/cookies"
|
||||
import router, { resetRouter } from "@/router"
|
||||
import { loginApi, getUserInfoApi } from "@/api/login"
|
||||
import type { ILoginData } from "@/api/login"
|
||||
import type { RouteRecordRaw } from "vue-router"
|
||||
import { type ILoginData, loginApi, getUserInfoApi } from "@/api/login"
|
||||
import { type RouteRecordRaw } from "vue-router"
|
||||
|
||||
export const useUserStore = defineStore("user", () => {
|
||||
const token = ref<string>(getToken() || "")
|
||||
|
@ -1,2 +1,2 @@
|
||||
// 注册多主题
|
||||
@import "@/styles/theme/dark/index.scss";
|
||||
@import "./dark/index.scss";
|
||||
|
2
src/utils/cache/localStorage.ts
vendored
2
src/utils/cache/localStorage.ts
vendored
@ -1,7 +1,7 @@
|
||||
/** 统一处理 localStorage */
|
||||
|
||||
import CacheKey from "@/constants/cacheKey"
|
||||
import type { ThemeName } from "@/hooks/useTheme"
|
||||
import { type ThemeName } from "@/hooks/useTheme"
|
||||
|
||||
export const getSidebarStatus = () => {
|
||||
return localStorage.getItem(CacheKey.SIDEBAR_STATUS)
|
||||
|
@ -1,9 +1,8 @@
|
||||
import axios from "axios"
|
||||
import type { AxiosInstance, AxiosRequestConfig } from "axios"
|
||||
import axios, { type AxiosInstance, type AxiosRequestConfig } from "axios"
|
||||
import { useUserStoreHook } from "@/store/modules/user"
|
||||
import { ElMessage } from "element-plus"
|
||||
import { get } from "lodash-es"
|
||||
import { getToken } from "@/utils/cache/cookies"
|
||||
import { getToken } from "./cache/cookies"
|
||||
|
||||
/** 创建请求实例 */
|
||||
function createService() {
|
||||
|
@ -4,9 +4,8 @@ import { useRouter } from "vue-router"
|
||||
import { useUserStore } from "@/store/modules/user"
|
||||
import { User, Lock, Key, Picture, Loading } from "@element-plus/icons-vue"
|
||||
import ThemeSwitch from "@/components/ThemeSwitch/index.vue"
|
||||
import type { FormInstance, FormRules } from "element-plus"
|
||||
import { getLoginCodeApi } from "@/api/login"
|
||||
import type { ILoginData } from "@/api/login"
|
||||
import { type FormInstance, FormRules } from "element-plus"
|
||||
import { type ILoginData, getLoginCodeApi } from "@/api/login"
|
||||
|
||||
const router = useRouter()
|
||||
const loginFormRef = ref<FormInstance | null>(null)
|
||||
|
@ -16,10 +16,7 @@
|
||||
/** https://cn.vitejs.dev/guide/features.html#typescript-compiler-options */
|
||||
"isolatedModules": true,
|
||||
"esModuleInterop": true,
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom"
|
||||
],
|
||||
"lib": ["esnext", "dom"],
|
||||
"skipLibCheck": true,
|
||||
"types": [
|
||||
"node",
|
||||
@ -31,22 +28,10 @@
|
||||
"baseUrl": ".",
|
||||
/** 非相对模块导入的路径映射配置,根据 baseUrl 配置进行路径计算 */
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"src/*"
|
||||
]
|
||||
},
|
||||
"@/*": ["src/*"]
|
||||
}
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.ts",
|
||||
"src/**/*.d.ts",
|
||||
"src/**/*.tsx",
|
||||
"src/**/*.vue",
|
||||
"types/**/*.d.ts",
|
||||
"vite.config.ts"
|
||||
],
|
||||
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue", "types/**/*.d.ts", "vite.config.ts"],
|
||||
/** 编译器默认排除的编译文件 */
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"dist"
|
||||
]
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
|
2
types/vue-router.d.ts
vendored
2
types/vue-router.d.ts
vendored
@ -1,4 +1,4 @@
|
||||
import 'vue-router'
|
||||
import "vue-router"
|
||||
|
||||
declare module "vue-router" {
|
||||
interface RouteMeta {
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { loadEnv } from "vite"
|
||||
import type { ConfigEnv, UserConfigExport } from "vite"
|
||||
import { type ConfigEnv, type UserConfigExport, loadEnv } from "vite"
|
||||
import path, { resolve } from "path"
|
||||
import vue from "@vitejs/plugin-vue"
|
||||
import { createSvgIconsPlugin } from "vite-plugin-svg-icons"
|
||||
|
Loading…
x
Reference in New Issue
Block a user