2017-10-21 44 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

相關問題