我相信1.0.x使用了history包。
你必須檢查你使用的歷史版本,但是從文檔有:
// Push a new entry onto the history stack.
history.push('/home')
// Replace the current entry on the history stack.
history.replace('/profile')
// Push a new entry with state onto the history stack.
history.push({
pathname: '/about',
search: '?the=search',
state: { some: 'state' }
})
// Change just the search on an existing location.
history.push({ ...location, search: '?the=other+search' })
// Go back to the previous history entry. The following
// two lines are synonymous.
history.go(-1)
history.goBack()