mirror of https://github.com/alibaba/ice.git
fix: page config type
This commit is contained in:
parent
fc21fd912f
commit
1d16997af8
|
|
@ -1,23 +1,12 @@
|
|||
import * as React from 'react';
|
||||
<<<<<<< HEAD
|
||||
import { useAppContext } from 'ice';
|
||||
import './home.css';
|
||||
|
||||
export default function About() {
|
||||
const appContext = useAppContext();
|
||||
|
||||
console.log('About Page: appContext', appContext);
|
||||
|
||||
return <><h2>About Page</h2></>;
|
||||
}
|
||||
=======
|
||||
import { Link } from 'ice';
|
||||
|
||||
export default function About() {
|
||||
return <><h2>About Page</h2><Link to="/">home</Link></>;
|
||||
}
|
||||
|
||||
About.pageConfig = {
|
||||
auth: ['guest'],
|
||||
};
|
||||
>>>>>>> 1d93732c... feat: router (#28)
|
||||
export function getPageConfig() {
|
||||
return {
|
||||
auth: ['guest'],
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,9 +14,6 @@ export function getPageConfig() {
|
|||
scripts: [
|
||||
{ src: 'https://g.alicdn.com/alilog/mlog/aplus_v2.js', block: true },
|
||||
],
|
||||
auth: ['admin'],
|
||||
};
|
||||
}
|
||||
|
||||
Home.pageConfig = {
|
||||
auth: ['admin'],
|
||||
};
|
||||
}
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
import * as React from 'react';
|
||||
|
||||
import type { PageConfig, PageAssets } from './types';
|
||||
interface DocumentContext {
|
||||
html?: string;
|
||||
pageAssets?: any;
|
||||
pageConfig?: any;
|
||||
pageAssets?: PageAssets;
|
||||
pageConfig?: PageConfig;
|
||||
}
|
||||
|
||||
const Context = React.createContext<DocumentContext>(null);
|
||||
|
|
|
|||
|
|
@ -48,9 +48,17 @@ export interface RouteMatch<RouteItem> {
|
|||
|
||||
export interface PageConfig {
|
||||
title?: string;
|
||||
meta?: any[];
|
||||
links?: any[];
|
||||
scripts?: any[];
|
||||
auth?: string[];
|
||||
}
|
||||
|
||||
export interface PageAssets {
|
||||
links?: any[];
|
||||
scripts?: any[];
|
||||
}
|
||||
|
||||
export type PageWrapper<InjectProps> = (<Props>(Component: ComponentType<Props & InjectProps>) => ComponentType<Props>);
|
||||
export type SetAppRouter = (AppRouter: ComponentType<AppRouterProps>) => void;
|
||||
export type AddProvider = (Provider: ComponentType) => void;
|
||||
|
|
|
|||
Loading…
Reference in New Issue