查看: 58|回复: 0

react 返回上一页

[复制链接]

1

主题

0

回帖

0

积分

热心网友

金币
0
阅读权限
220
精华
0
威望
0
贡献
0
在线时间
0 小时
注册时间
2008-7-15
发表于 2019-5-23 13:55:00 | 显示全部楼层 |阅读模式
import * as React from 'react'
import { Layout } from 'antd';
import creatHistory from 'history/createHashHistory'  //返回上一页这段代码
const history = creatHistory();//返回上一页这段代码
import './index.less'
const { Header,  Sider, Content } = Layout;
export interface IProps {
    test?: any
    history?:any
    
  }
  interface IState {
    
    
  }
export default class ReachInfos extends React.Component<IProps, IState> {
    constructor(props: IProps) {
      super(props)
    }
    goBackPage = () => {
      history.goBack();  //返回上一页这段代码
      
    }
    render(){
        return (
            <div className="videoDetail">
              <Layout>
                <Header>
                  <div className="headTitle">
                      <span onClick={this.goBackPage} className="goBack"> <返回 </span>
                      <span className="title">视频详情</span>
                  </div>
                </Header>
                <Layout>
                  <Sider>
                    <h4>视频信息:</h4>

                    <ul>
                      <li>拍摄时间:</li>
                      <li>2018-10-11</li>
                    </ul>
                    <ul>
                      <li>拍摄地址:</li>
                      <li>雁塔区</li>
                    </ul>
                    
                  </Sider>
                  <Content>
                  <iframe src="http://gbs.liveqing.com:10000/play.html?serial=34020000001110000033&code=34020000001320000101&aspect=fullscreen" width="100%" height="360" allow="autoplay; fullscreen"></iframe>
                    {/* <video autoPlay controls width="100%" src="https://media.w3.org/2010/05/sintel/trailer_hd.mp4"></video> */}
                  </Content>
                  <Sider>Sider</Sider>
                </Layout>
               
              </Layout>
            </div>
        )
    }
}

  



来源:https://www.cnblogs.com/whlBooK/p/10911472.html
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

相关侵权、举报、投诉及建议等,请发 E-mail:qiongdian@foxmail.com

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部