Open
Description
What problem does this feature solve?
This feature would address many requests seen in relation to having greater control over applications history, stack management, initial route, and a few others.
There are several supported history modes. My proposal is to allow mode
option accept an instance of a class that implements History API.
Instantiation would look like:
import { AbstractHistory } from 'vue-router'
class CustomHistory extends AbstractHistory {
...
}
const customHistory = new CustomHistory()
const router = new VueRouter({
mode: customHistory,
routes: [...]
})
This would give great flexibility to developers and would allow further integrations of cool features such as keeping reactive history with vuex
.
What does the proposed API look like?
mode
option would accept String
or an instance of AbstractHistory
. Internally, if an instance is detected, the history manipulation would happen through it.