File tree 1 file changed +11
-4
lines changed
1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ const routes = [
9
9
{
10
10
path : '/components' ,
11
11
component : Layout ,
12
- props : route => {
12
+ props : ( route ) => {
13
13
const name = route . path . split ( '/components/' ) [ 1 ] . split ( '/' ) [ 0 ] ;
14
14
return { name, showDemo : true } ;
15
15
} ,
@@ -18,9 +18,9 @@ const routes = [
18
18
{
19
19
path : '/iframe' ,
20
20
component : Iframe ,
21
- children : demoRoutes . map ( item => ( {
21
+ children : demoRoutes . map ( ( item ) => ( {
22
22
...item ,
23
- props : route => {
23
+ props : ( route ) => {
24
24
const hash = route . hash . replace ( '#' , '' ) ;
25
25
return { iframeName : hash } ;
26
26
} ,
@@ -29,7 +29,7 @@ const routes = [
29
29
{
30
30
path : '/' ,
31
31
component : Layout ,
32
- props : route => {
32
+ props : ( route ) => {
33
33
const name = route . path . split ( '/docs/vue/' ) [ 1 ] . split ( '/' ) [ 0 ] ;
34
34
return { name, showApi : true } ;
35
35
} ,
@@ -116,4 +116,11 @@ export default new VueRouter({
116
116
mode : 'history' ,
117
117
fallback : false ,
118
118
routes,
119
+ scrollBehavior : ( to ) => {
120
+ if ( to . hash ) {
121
+ return {
122
+ selector : to . hash ,
123
+ } ;
124
+ }
125
+ } ,
119
126
} ) ;
You can’t perform that action at this time.
0 commit comments