import { createBrowserHistory, createHashHistory } from 'history';
const history = createBrowserHistory() // history模式
const history = createHashHistory() // hash模式
history.push('/')
interface HistoryProp {
history?: History & { push: (str: string) => void};
}
(history as HistoryProp).push('/')
网友评论