mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 12:09:14 +08:00
site: complete title
This commit is contained in:
parent
f6d5653259
commit
0a701837eb
@ -3,6 +3,8 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>Ant Design - 一个 UI 设计语言</title>
|
||||
<link rel="icon" href="https://t.alipayobjects.com/images/T1QUBfXo4fXXXXXXXX.png" type="image/x-icon">
|
||||
<link rel="stylesheet" type="text/css" href="./index.css"/>
|
||||
<!--[if lt IE 10]>
|
||||
<script src="https://as.alipayobjects.com/g/component/??console-polyfill/0.2.2/index.js,es5-shim/4.1.14/es5-shim.min.js,es5-shim/4.1.14/es5-sham.min.js,html5shiv/3.7.2/html5shiv.min.js,media-match/2.0.2/media.match.min.js"></script>
|
||||
|
@ -12,6 +12,14 @@ export default class Article extends React.Component {
|
||||
this.enhanceVideo = this.enhanceVideo.bind(this);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.componentDidUpdate();
|
||||
}
|
||||
componentDidUpdate() {
|
||||
const { chinese, english } = this.props.content.meta;
|
||||
utils.setTitle(`${chinese || english} - Ant Design`);
|
||||
}
|
||||
|
||||
isPreviewImg(string) {
|
||||
return /^<img\s/i.test(string) && /preview-img/gi.test(string);
|
||||
}
|
||||
|
@ -15,6 +15,14 @@ export default class ComponentDoc extends React.Component {
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.componentDidUpdate();
|
||||
}
|
||||
componentDidUpdate() {
|
||||
const { chinese, english } = this.props.doc.meta;
|
||||
utils.setTitle(`${chinese} ${english} - Ant Design`);
|
||||
}
|
||||
|
||||
handleExpandToggle() {
|
||||
this.setState({
|
||||
expandAll: !this.state.expandAll,
|
||||
|
@ -7,7 +7,16 @@ import Page3 from './Page3';
|
||||
import Page4 from './Page4';
|
||||
import './index.less';
|
||||
|
||||
import * as utils from '../utils';
|
||||
|
||||
export default class Home extends React.Component {
|
||||
componentDidMount() {
|
||||
this.componentDidUpdate();
|
||||
}
|
||||
componentDidUpdate() {
|
||||
utils.setTitle('Ant Design - 一个 UI 设计语言');
|
||||
}
|
||||
|
||||
// To store style which is only for Home and has conflicts with others.
|
||||
getStyle() {
|
||||
return `
|
||||
|
@ -75,3 +75,8 @@ export function objectToComponent(pathname, object, index) {
|
||||
children && children.map(objectToComponent.bind(null, pathname)) // `hr` has no children
|
||||
);
|
||||
}
|
||||
|
||||
const docTitle = document.head.querySelector('title');
|
||||
export function setTitle(title) {
|
||||
docTitle.text = title;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user