dva在组件和model外进行路由跳转

import createHistory from 'history/createBrowserHistory';

const history = createHistory();
export default history;
import history from './utils/history';
const app = dva({
  history: history)}
然后在需要的地方直接饮用
history.push('/');

猜你喜欢

转载自www.cnblogs.com/unreal-feather/p/10335096.html