mirror of
https://gitee.com/fantastic-admin/basic.git
synced 2024-12-05 13:37:45 +08:00
将类型定义 d.ts 文件统一存放到 /src/types/ 目录下
This commit is contained in:
parent
c9f7cdc5c3
commit
67bed03411
30
src/components.d.ts
vendored
30
src/components.d.ts
vendored
@ -1,30 +0,0 @@
|
||||
// generated by unplugin-vue-components
|
||||
// We suggest you to commit this file into source control
|
||||
// Read more: https://github.com/vuejs/core/pull/3399
|
||||
import '@vue/runtime-core'
|
||||
|
||||
export {}
|
||||
|
||||
declare module '@vue/runtime-core' {
|
||||
export interface GlobalComponents {
|
||||
Auth: typeof import('./components/Auth/index.vue')['default']
|
||||
AuthAll: typeof import('./components/AuthAll/index.vue')['default']
|
||||
BatchActionBar: typeof import('./components/BatchActionBar/index.vue')['default']
|
||||
Copyright: typeof import('./components/Copyright/index.vue')['default']
|
||||
Editor: typeof import('./components/Editor/index.vue')['default']
|
||||
FileUpload: typeof import('./components/FileUpload/index.vue')['default']
|
||||
FixedActionBar: typeof import('./components/FixedActionBar/index.vue')['default']
|
||||
ImagePreview: typeof import('./components/ImagePreview/index.vue')['default']
|
||||
ImagesUpload: typeof import('./components/ImagesUpload/index.vue')['default']
|
||||
ImageUpload: typeof import('./components/ImageUpload/index.vue')['default']
|
||||
PageHeader: typeof import('./components/PageHeader/index.vue')['default']
|
||||
PageMain: typeof import('./components/PageMain/index.vue')['default']
|
||||
PcasCascader: typeof import('./components/PcasCascader/index.vue')['default']
|
||||
RouterLink: typeof import('vue-router')['RouterLink']
|
||||
RouterView: typeof import('vue-router')['RouterView']
|
||||
SearchBar: typeof import('./components/SearchBar/index.vue')['default']
|
||||
SvgIcon: typeof import('./components/SvgIcon/index.vue')['default']
|
||||
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
|
||||
Trend: typeof import('./components/Trend/index.vue')['default']
|
||||
}
|
||||
}
|
@ -6,7 +6,7 @@ import eventBus from '@/utils/eventBus'
|
||||
import useSettingsStore from '@/store/modules/settings'
|
||||
import useRouteStore from '@/store/modules/route'
|
||||
import useMenuStore from '@/store/modules/menu'
|
||||
import type { Menu, Route } from '@/global'
|
||||
import type { Menu, Route } from '@/types/global'
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
// import SidebarItem from './index.vue'
|
||||
import { resolveRoutePath } from '@/utils'
|
||||
import useSettingsStore from '@/store/modules/settings'
|
||||
import type { Menu } from '@/global'
|
||||
import type { Menu } from '@/types/global'
|
||||
|
||||
const props = defineProps({
|
||||
item: {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import MultilevelMenuExample from './modules/multilevel.menu.example'
|
||||
|
||||
import type { Menu } from '@/global'
|
||||
import type { Menu } from '@/types/global'
|
||||
|
||||
const menu: Menu.recordMainRaw[] = [
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { Menu } from '@/global'
|
||||
import type { Menu } from '@/types/global'
|
||||
|
||||
const menus: Menu.recordRaw = {
|
||||
meta: {
|
||||
|
@ -11,7 +11,7 @@ import MockExample from './modules/mock.example'
|
||||
import JsxExample from './modules/jsx.example'
|
||||
import ExternalLinkExample from './modules/external.link.example'
|
||||
import EcologyExample from './modules/ecology.example'
|
||||
import type { Route } from '@/global'
|
||||
import type { Route } from '@/types/global'
|
||||
import useSettingsStore from '@/store/modules/settings'
|
||||
|
||||
// 固定路由(默认路由)
|
||||
|
@ -1,6 +1,6 @@
|
||||
// 该文件为系统默认配置,请勿修改!!!
|
||||
|
||||
import type { RecursiveRequired, Settings } from './global'
|
||||
import type { RecursiveRequired, Settings } from '@/types/global'
|
||||
|
||||
const globalSettingsDefault: RecursiveRequired<Settings.all> = {
|
||||
app: {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { Settings } from './global'
|
||||
import type { Settings } from '@/types/global'
|
||||
|
||||
const globalSettings: Settings.all = {
|
||||
app: {
|
||||
|
@ -2,7 +2,7 @@ import { cloneDeep } from 'lodash-es'
|
||||
import useSettingsStore from './settings'
|
||||
import useUserStore from './user'
|
||||
import useRouteStore from './route'
|
||||
import type { Menu } from '@/global'
|
||||
import type { Menu } from '@/types/global'
|
||||
|
||||
import { resolveRoutePath } from '@/utils'
|
||||
import api from '@/api'
|
||||
|
@ -5,7 +5,7 @@ import useUserStore from './user'
|
||||
import api from '@/api'
|
||||
import { resolveRoutePath } from '@/utils'
|
||||
import { systemRoutes } from '@/router/routes'
|
||||
import type { Route } from '@/global'
|
||||
import type { Route } from '@/types/global'
|
||||
|
||||
function hasPermission(permissions: string[], route: Route.recordMainRaw | RouteRecordRaw) {
|
||||
let isAuth = false
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { defaultsDeep } from 'lodash-es'
|
||||
import type { RouteMeta } from 'vue-router'
|
||||
import type { RecursiveRequired, Settings } from '@/global'
|
||||
import type { RecursiveRequired, Settings } from '@/types/global'
|
||||
import settings from '@/settings'
|
||||
import settingsDefault from '@/settings.default'
|
||||
|
||||
|
@ -60,13 +60,13 @@ declare global {
|
||||
const triggerRef: typeof import('vue')['triggerRef']
|
||||
const unref: typeof import('vue')['unref']
|
||||
const useAttrs: typeof import('vue')['useAttrs']
|
||||
const useAuth: typeof import('./utils/composables/useAuth')['default']
|
||||
const useAuth: typeof import('../utils/composables/useAuth')['default']
|
||||
const useCssModule: typeof import('vue')['useCssModule']
|
||||
const useCssVars: typeof import('vue')['useCssVars']
|
||||
const useGlobalProperties: typeof import('./utils/composables/useGlobalProperties')['default']
|
||||
const useGlobalProperties: typeof import('../utils/composables/useGlobalProperties')['default']
|
||||
const useLink: typeof import('vue-router')['useLink']
|
||||
const useMainPage: typeof import('./utils/composables/useMainPage')['default']
|
||||
const useMenu: typeof import('./utils/composables/useMenu')['default']
|
||||
const useMainPage: typeof import('../utils/composables/useMainPage')['default']
|
||||
const useMenu: typeof import('../utils/composables/useMenu')['default']
|
||||
const useRoute: typeof import('vue-router')['useRoute']
|
||||
const useRouter: typeof import('vue-router')['useRouter']
|
||||
const useSlots: typeof import('vue')['useSlots']
|
30
src/types/components.d.ts
vendored
Normal file
30
src/types/components.d.ts
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
// generated by unplugin-vue-components
|
||||
// We suggest you to commit this file into source control
|
||||
// Read more: https://github.com/vuejs/core/pull/3399
|
||||
import '@vue/runtime-core'
|
||||
|
||||
export {}
|
||||
|
||||
declare module '@vue/runtime-core' {
|
||||
export interface GlobalComponents {
|
||||
Auth: typeof import('./../components/Auth/index.vue')['default']
|
||||
AuthAll: typeof import('./../components/AuthAll/index.vue')['default']
|
||||
BatchActionBar: typeof import('./../components/BatchActionBar/index.vue')['default']
|
||||
Copyright: typeof import('./../components/Copyright/index.vue')['default']
|
||||
Editor: typeof import('./../components/Editor/index.vue')['default']
|
||||
FileUpload: typeof import('./../components/FileUpload/index.vue')['default']
|
||||
FixedActionBar: typeof import('./../components/FixedActionBar/index.vue')['default']
|
||||
ImagePreview: typeof import('./../components/ImagePreview/index.vue')['default']
|
||||
ImagesUpload: typeof import('./../components/ImagesUpload/index.vue')['default']
|
||||
ImageUpload: typeof import('./../components/ImageUpload/index.vue')['default']
|
||||
PageHeader: typeof import('./../components/PageHeader/index.vue')['default']
|
||||
PageMain: typeof import('./../components/PageMain/index.vue')['default']
|
||||
PcasCascader: typeof import('./../components/PcasCascader/index.vue')['default']
|
||||
RouterLink: typeof import('vue-router')['RouterLink']
|
||||
RouterView: typeof import('vue-router')['RouterView']
|
||||
SearchBar: typeof import('./../components/SearchBar/index.vue')['default']
|
||||
SvgIcon: typeof import('./../components/SvgIcon/index.vue')['default']
|
||||
SystemInfo: typeof import('./../components/SystemInfo/index.vue')['default']
|
||||
Trend: typeof import('./../components/Trend/index.vue')['default']
|
||||
}
|
||||
}
|
0
src/global.d.ts → src/types/global.d.ts
vendored
0
src/global.d.ts → src/types/global.d.ts
vendored
38
src/shims.d.ts → src/types/shims.d.ts
vendored
38
src/shims.d.ts → src/types/shims.d.ts
vendored
@ -1,19 +1,19 @@
|
||||
declare interface Window {
|
||||
webkitDevicePixelRatio: any
|
||||
mozDevicePixelRatio: any
|
||||
}
|
||||
|
||||
declare module '*.vue' {
|
||||
import { type DefineComponent } from 'vue'
|
||||
const component: DefineComponent<{}, {}, any>
|
||||
export default component
|
||||
}
|
||||
|
||||
declare const __SYSTEM_INFO__: {
|
||||
pkg: {
|
||||
version: string
|
||||
dependencies: Recordable<string>
|
||||
devDependencies: Recordable<string>
|
||||
}
|
||||
lastBuildTime: string
|
||||
}
|
||||
declare interface Window {
|
||||
webkitDevicePixelRatio: any
|
||||
mozDevicePixelRatio: any
|
||||
}
|
||||
|
||||
declare module '*.vue' {
|
||||
import { type DefineComponent } from 'vue'
|
||||
const component: DefineComponent<{}, {}, any>
|
||||
export default component
|
||||
}
|
||||
|
||||
declare const __SYSTEM_INFO__: {
|
||||
pkg: {
|
||||
version: string
|
||||
dependencies: Recordable<string>
|
||||
devDependencies: Recordable<string>
|
||||
}
|
||||
lastBuildTime: string
|
||||
}
|
@ -7,7 +7,7 @@ export default function createAutoImport() {
|
||||
'vue-router',
|
||||
'pinia',
|
||||
],
|
||||
dts: 'src/auto-imports.d.ts',
|
||||
dts: './src/types/auto-imports.d.ts',
|
||||
dirs: [
|
||||
'./src/utils/composables/**',
|
||||
],
|
||||
|
@ -4,6 +4,6 @@ export default function createComponents() {
|
||||
return components({
|
||||
dirs: ['src/components'],
|
||||
include: [/\.vue$/, /\.vue\?vue/, /\.tsx$/],
|
||||
dts: 'src/components.d.ts',
|
||||
dts: './src/types/components.d.ts',
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user