feat: support document title

This commit is contained in:
chenos 2020-12-19 15:48:56 +08:00
parent 5fdbc1b10d
commit ddcf0f4219
6 changed files with 23 additions and 1 deletions

View File

@ -1,6 +1,7 @@
import { defineConfig } from 'umi';
export default defineConfig({
title: false,
nodeModulesTransform: {
type: 'none',
},

View File

@ -3,6 +3,7 @@ import ViewFactory from '@/components/views';
import { PageHeader, Tabs, Button, Statistic, Descriptions } from 'antd';
import { useRequest, request, Spin } from '@nocobase/client';
import { getPathName } from './utils';
import { Helmet } from 'umi';
export function CollectionIndex(props) {
const { lastPage } = props;
@ -11,6 +12,9 @@ export function CollectionIndex(props) {
return (
<div>
<Helmet>
<title>{title}</title>
</Helmet>
<PageHeader
ghost={false}
title={title}

View File

@ -5,6 +5,7 @@ import { getPathName, redirectTo } from './utils';
import api from '@/api-client';
import { useRequest } from 'umi';
import { Spin } from '@nocobase/client';
import { Helmet } from 'umi';
export function CollectionSingle(props) {
console.log(props);
@ -26,6 +27,9 @@ export function CollectionSingle(props) {
}
return (
<div>
<Helmet>
<title>{data.pageTitle}</title>
</Helmet>
<PageHeader
ghost={false}
onBack={() => {

View File

@ -1,12 +1,17 @@
import React from 'react';
import { PageHeader } from 'antd';
import './style.less';
import { Helmet } from 'umi';
export function Page(props: any) {
const { children, ...restProps } = props;
const { title, children, ...restProps } = props;
return (
<div>
<Helmet>
<title>{title}</title>
</Helmet>
<PageHeader
title={title}
ghost={false}
{...restProps}
/>

View File

@ -2,10 +2,14 @@ import React from 'react';
import { Link } from 'umi';
import { Page } from '@/components/pages';
import ViewFactory from '@/components/views';
import { Helmet } from 'umi';
export default (props: any) => {
return (
<div>
<Helmet>
<title>{'登录 NocoBase'}</title>
</Helmet>
<ViewFactory
{...props}
viewName={'login'}

View File

@ -2,10 +2,14 @@ import React from 'react';
import { Link } from 'umi';
import { Page } from '@/components/pages';
import ViewFactory from '@/components/views';
import { Helmet } from 'umi';
export default (props: any) => {
return (
<div>
<Helmet>
<title>{'注册 NocoBase'}</title>
</Helmet>
<ViewFactory
{...props}
viewName={'register'}