9
9
<v-list >
10
10
<v-divider ></v-divider >
11
11
<template v-for =" (item ) in menu_items " >
12
- <v-list-tile exact :key =" item.title" :href =" item.href" :to =" {name: item.href }" >
12
+ <v-list-tile exact :key =" item.title" :href =" item.href" :to =" {name: item.title, params: item.params }" >
13
13
<v-list-tile-action style =" padding-left :10px ;" >
14
14
<v-icon light v-html =" item.icon" ></v-icon >
15
15
</v-list-tile-action >
21
21
</v-list >
22
22
</v-navigation-drawer >
23
23
<v-toolbar color =" primary" dark fixed app >
24
+ <v-btn icon v-if =" $route.params.type=='Action'" v-on:click =" goBack()" >
25
+ <v-icon >arrow_back</v-icon >
26
+ </v-btn >
24
27
<v-toolbar-side-icon v-if =" $route.params.type!='Action'" @click.stop =" drawer = !drawer" ></v-toolbar-side-icon >
25
28
<v-toolbar-title >
26
- {{pageTitle}}
29
+ <template v-if =" $route .params .pageName " >
30
+ {{$route.params.pageName}}
31
+ </template >
32
+ <template v-else >
33
+ Vue Advanced Features
34
+ </template >
27
35
</v-toolbar-title >
28
36
</v-toolbar >
29
37
<v-content class =" grey lighten-4" >
30
38
<router-view ></router-view >
31
39
</v-content >
32
40
<v-footer color =" primary" app >
33
- <span class =" white--text caption pa-2 mx-3" > © ; Made with love by Jeyabalaji</span >
41
+ <span class =" white--text caption pa-2 mx-3" > © ; Made with passion by Jeyabalaji Subramanian </span >
42
+ <a href =" www.jeyabalaji.com" ></a >
34
43
</v-footer >
35
44
</v-app >
36
45
</template >
@@ -39,26 +48,43 @@ export default {
39
48
data () {
40
49
return {
41
50
drawer: true ,
42
- pageTitle: this .$store .state .pageTitle ,
43
51
menu_items: [
44
52
{
45
53
href: " home" ,
46
54
router: true ,
47
55
title: " Home" ,
48
- icon: " home"
56
+ icon: " home" ,
57
+ params: {
58
+ pageName: " Vue Advanced Features" ,
59
+ type: " List"
60
+ }
49
61
},
50
62
{
51
63
href: " componentBasics" ,
52
64
router: true ,
53
65
title: " Component Basics" ,
54
- icon: " launch"
55
- }
66
+ icon: " launch" ,
67
+ params: {
68
+ pageName: " Component Basics" ,
69
+ type: " Action"
70
+ }
71
+ },
72
+ {
73
+ href: " componentEvents" ,
74
+ router: true ,
75
+ title: " Component Communication" ,
76
+ icon: " settings_input_component" ,
77
+ params: {
78
+ pageName: " Component Communication" ,
79
+ type: " Action"
80
+ }
81
+ }
56
82
],
57
83
};
58
84
},
59
- created () {
60
- if ( typeof this . pageTitle == ' undefined ' || this . pageTitle == null ) {
61
- this . pageTitle = " Vue Advanced Features Demo " ;
85
+ methods : {
86
+ goBack : function ( ) {
87
+ this . $router . go ( - 1 ) ;
62
88
}
63
89
}
64
90
};
0 commit comments