Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.1k views
in Technique[技术] by (71.8m points)

history.push跳转后页面空白

使用umi的history.push进行路由跳转后页面空白

路由配置为

                    {
                      path: '/manage/query/table',
                      name: '管理表格',
                      component: './Manage/Query/component/queryTable',
                      hideInMenu:true,
                    },

路由跳转是点击一张图片实现跳转

                <div onClick={()=>{history.push({pathname:'/manage/query/table'})}}>
                    <img src={table}/>
                </div>

点击之后留地址栏改变,变成http://localhost:8000/manage/query/table,但是没有内容显示,一片空白,如下图所示:
image.png

请问这个问题该如何解决?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

楼上说的对,如果是路由匹配正确但是没找到对应模块,会有报错的,如果没报错,要看你这个匹配上的模块内部有没有错误,比如获取数据于DOM填充不匹配,在生产模式也会导致白屏,要一步步看的


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...