0👍
Maybe you uses replace option on your anchor.
please check out your tag has this property
<router-link :to="..." **replace**>
0👍
Then call $router.go(-1) and that direct me to / instead of /items/iphone5
go method is based on history API
go(-1) returns to previous entry stored in the current history entry
I go / then /items/iphone5 then /items/phone6
You have to inspect whether the history entry counts for your route or try using history mode
vue router default mode is hash.
const router = new VueRouter({
mode: 'history',
routes: [...]
})
Read docs for more info [Read caveats in the last and Server Side Rendering in first place if you have some time]
- [Vuejs]-Input field unable to change model when component and model are dynamically created
- [Vuejs]-How can I do a easy image replace with opacity transition in vue?
Source:stackexchange.com