动态修改title
This commit is contained in:
parent
db9bfa7576
commit
baed9df260
|
|
@ -43,8 +43,13 @@ function memo_show(props) {
|
|||
useEffect(() => {
|
||||
init();
|
||||
related_memos();
|
||||
return componentWillUnmount
|
||||
}, [memo_id]);
|
||||
|
||||
function componentWillUnmount() {
|
||||
document.title = '论坛交流'
|
||||
}
|
||||
|
||||
async function init() {
|
||||
setSpinType(true);
|
||||
let url = `/memos/${memo_id}.json`;
|
||||
|
|
@ -69,6 +74,7 @@ function memo_show(props) {
|
|||
setRecentmemos(result.data.recent_memos);
|
||||
setIsBanned(result.data.is_banned);
|
||||
getMemoUser(result.data.author_info);
|
||||
document.title = `${result.data.memo.subject}/${result.data.memo.forum_tag && result.data.memo.forum_tag.title}`
|
||||
}
|
||||
setSpinType(false);
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue