Skip to content

Commit

Permalink
perf: 新增types文件夹定义全局type
Browse files Browse the repository at this point in the history
  • Loading branch information
BoBoooooo committed Nov 20, 2020
1 parent da9bcdb commit d8d37b2
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/types/shims-vue-expand.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* @file: 声明vue拓展原型链上的属性类型
* @copyright: NanJing Anshare Tech .Com
* @author: BoBo
* @Date: 2020年06月23 16:47:06
*/
/* eslint-disable */
import VueRouter, { Route } from 'vue-router';

import { Store } from 'vuex';

// 扩充
declare module 'vue/types/vue' {
interface Vue {
$router: VueRouter;
$route: Route;
$store: Store<any>;
lodash: any;
axios: any;
dayjs: any;
$pinyinmatch: any;
HOST_URL: any;
API_URL: any;
}
}

declare global {
interface Window {
__HOST__URL__: string;
__PREFIX__URL__: string;
}
}

11 changes: 11 additions & 0 deletions src/types/shims-vue.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* @file: 让ts识别vue文件,声明第三方模块
* @copyright: NanJing Anshare Tech .Com
* @author: BoBo
* @Date: 2020年06月22 16:26:22
*/
declare module '*.vue' {
import Vue from 'vue';

export default Vue;
}
10 changes: 10 additions & 0 deletions src/types/vuex.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
interface SystemConfig {
passwordLength: string,
clientTimeOut: string,
initialPassword: string,
systemName: string,
}

interface SideBarState {
opened: 1 | 0
}

0 comments on commit d8d37b2

Please sign in to comment.