【react组件显示标题】

react组件显示标题

	class route extends Component{
    
    
		render(){
    
    
			window.document.title="页面标题XXX"
		}
	}


window.document.title=“页面标题XXX”

写在class外面,则会出现最后一个赋值覆盖问题,即最后一个读取的会覆盖之前一个值,所以要写在render里面

猜你喜欢

转载自blog.csdn.net/Little_Matches/article/details/126761164