fix: move page templates to pages/index

This commit is contained in:
chenos 2021-03-22 14:12:11 +08:00
parent bd1449e87a
commit e443857309
3 changed files with 11 additions and 20 deletions

View File

@ -2,7 +2,7 @@ import React, { useState } from 'react';
// import { request } from 'umi'; // import { request } from 'umi';
import { TemplateLoader } from './TemplateLoader'; import { TemplateLoader } from './TemplateLoader';
import { useRequest, request } from '@nocobase/client'; import { useRequest, request } from '@nocobase/client';
import templates from '@/templates'; import { templates } from '@/pages';
import api from '@/api-client'; import api from '@/api-client';
export function PageLoader(props: any) { export function PageLoader(props: any) {

View File

@ -1,4 +1,13 @@
// import PageLoader from '@nocobase/plugin-pages/lib/components/index';
import PageLoader from '@/components/pages'; import PageLoader from '@/components/pages';
export const templates = {
TopMenuLayout: require('@/components/pages/TopMenuLayout').default,
SideMenuLayout: require('@/components/pages/SideMenuLayout').default,
AdminLoader: require('@/components/pages/AdminLoader').default,
login: require('@/pages/login').default,
register: require('@/pages/register').default,
lostpassword: require('@/pages/lostpassword').default,
resetpassword: require('@/pages/resetpassword').default,
};
export default PageLoader; export default PageLoader;

View File

@ -1,18 +0,0 @@
/**
*
*/
export default {
'TopMenuLayout': require('@/components/pages/TopMenuLayout').default,
'SideMenuLayout': require('@/components/pages/SideMenuLayout').default,
'layout1': require('@/components/pages/TopMenuLayout').default,
'layout2': require('@/components/pages/SideMenuLayout').default,
'page1': require('@/pages/page1').default,
'page2': require('@/pages/page2').default,
'page3': require('@/pages/page3').default,
'page4': require('@/pages/page4').default,
login: require('@/pages/login').default,
register: require('@/pages/register').default,
lostpassword: require('@/pages/lostpassword').default,
resetpassword: require('@/pages/resetpassword').default,
AdminLoader: require('@/components/pages/AdminLoader').default,
};