2017-10-21 45 views
0

当用户单击链接时,它将引导用户进入结帐页面。重定向到另一个页面后保留重新存储值

selectSlot(slot){ 
    window.location = `/checkout/${slot.target.value}` 
} 

我的方法不会保留redux商店的价值。 我该如何保留这些值?

这里是路由器定义

<Provider store={store}> 
     <ConnectedRouter history={history}> 
      <Router> 
       <Switch> 
        <Route exact path="/" component={MainLayout} /> 
        <Route exact path="/index.html" component={MainLayout} /> 
        <Route path="/checkout" component={CheckoutLayout} /> 
        <Route component={NotFound}/> 
       </Switch> 
      </Router> 
     </ConnectedRouter> 
    </Provider> 
+0

你正在使用哪个版本的React路由器? –

回答

0

react-router-dom为宗旨,我使用Link,并为我工作。你可以阅读关于它here

相关问题