build(projects): update tsconfig、eslintrc

This commit is contained in:
Soybean
2022-03-12 16:21:40 +08:00
parent 4093dcd6dc
commit 75de2b0604
131 changed files with 1174 additions and 1140 deletions

View File

@@ -2,7 +2,7 @@ import { provide, inject } from 'vue';
import type { InjectionKey } from 'vue';
/** 创建共享上下文状态 */
export default function useContext<T>(contextName: string = 'context') {
export default function useContext<T>(contextName = 'context') {
const injectKey: InjectionKey<T> = Symbol(contextName);
function useProvide(context: T) {
@@ -10,11 +10,11 @@ export default function useContext<T>(contextName: string = 'context') {
}
function useInject() {
return inject(injectKey)!;
return inject(injectKey) as T;
}
return {
useProvide,
useInject
useInject,
};
}