feat(projects): 登录页面实现

This commit is contained in:
Soybean
2021-09-11 02:34:36 +08:00
parent 5c01006306
commit f1e7cf608e
47 changed files with 780 additions and 153 deletions

View File

@@ -0,0 +1,20 @@
import { provide, inject } from 'vue';
import type { InjectionKey } from 'vue';
/** 创建共享上下文状态 */
export default function useCreateContext<T>(contextName: string = 'context') {
const injectKey: InjectionKey<T> = Symbol(contextName);
function useProvider(shareState: T) {
provide(injectKey, shareState);
}
function useContext() {
return inject(injectKey);
}
return {
useProvider,
useContext
};
}