File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed
Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change 11<template >
22 <div id =" app" >
33 <v-app >
4- <AppMenu >
4+ <AppMenu :initialRoute = " initialRoute " >
55 </AppMenu >
66 <router-view ></router-view >
77 </v-app >
1212import AppMenu from ' ./common/component/AppMenu'
1313
1414export default {
15- name: ' App' ,
16- components: {
15+ name: ' App' ,
16+ components: {
1717 AppMenu
18+ },
19+ data () {
20+ return {
21+ initialRoute: " scalars"
22+ }
23+ },
24+ created () {
25+ if (location .hash && location .hash != ' #/' ) {
26+ this .initialRoute = / (\#\/ )(\w * )([?|&] {0,1} )/ .exec (location .hash )[2 ];
27+ }
28+ else {
29+ location .hash = ' #/scalars' ;
30+ }
1831 }
1932}
2033 </script >
Original file line number Diff line number Diff line change 1515
1616<script >
1717export default {
18+ props: [' initialRoute' ],
1819 name: ' AppMenu' ,
1920 data () {
2021 return {
21- selected: ' scalars ' ,
22+ selected: this . initialRoute ,
2223 items: [
2324 {
2425 url: ' /scalars' ,
You can’t perform that action at this time.
0 commit comments