[+] Dynamically initialize first state based on pathname
This commit is contained in:
@@ -19,8 +19,9 @@ export default class Navigation extends Vue
|
|||||||
*/
|
*/
|
||||||
public created()
|
public created()
|
||||||
{
|
{
|
||||||
// Set history state (TODO: Dynamically detect initial url
|
// Set history state
|
||||||
window.history.replaceState({lastTab: 'overall'}, '', '/overall');
|
let url = window.location.pathname;
|
||||||
|
window.history.replaceState({lastTab: url.substring(1)}, '', url);
|
||||||
|
|
||||||
// Create history state listener
|
// Create history state listener
|
||||||
window.onpopstate = e =>
|
window.onpopstate = e =>
|
||||||
|
|||||||
Reference in New Issue
Block a user