这适用于常规对象:
export const Components = {
[Pages.home]: Home.Page,
[Pages.login]: Login.Page,
[Pages.logout]: Logout.Page,
[Pages.dashboardManage]: DashboardManage.Page,
[Pages.dashboardOrganizationTable]: DashboardOrganizationTable.Page,
[Pages.organizationSettings]: OrganizationSettings.Page,
}
type PageKeysInUse = keyof typeof Components
type PagesInUse = { [key in PageKeysInUse]: any }
export const Resolvers: PagesInUse = {
[Pages.home]: Home.Page,
[Pages.login]: Login.Page,
[Pages.logout]: Logout.Page,
[Pages.dashboardManage]: DashboardManage.Page,
[Pages.dashboardOrganizationTable]: DashboardOrganizationTable.Page,
[Pages.organizationSettings]: OrganizationSettings.Page,
}