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

Categories

我看了ant design pro 文档 上面 说是 import router from 'umi',直接router.push('/xxxx');
新版本中并没有router。现在需求是
if(true){
router.push('/xxxx')
}

请问用什么方法来实现当前页面跳转### 问题描述

问题出现的环境背景及自己尝试过哪些方法

相关代码

粘贴代码文本(请勿用截图)

你期待的结果是什么?实际看到的错误信息又是什么?


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

1 Answer

新版本叫 history

import { history } from 'umi';

// 跳转到指定路由
history.push('/list');

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...