2017-02-28 93 views
2

我们可以在admin-on-rest(React JS)中使用浏览器历史记录,而不是使用hashhistory吗? 我是否需要更改管理员休眠中的某些内容,或者只需将服务器设置为处理URL?使用浏览器历史记录admin-on-rest

回答

1

是的,你可以,但你需要编写一个自定义的应用程序,而不是使用<Admin>组件。它记录在the official documentation

2

显然,现在只要创建一个从history包浏览器历史记录的一个实例,并把它传递给<Admin />组件的问题:

import createHistory from 'history/createBrowserHistory'; 

const history = createHistory(); 

const App =() => (
    <Admin history={history}> 
     ... 
    </Admin> 
); 

documentation

相关问题