This commit is contained in:
2019-04-16 22:31:40 +00:00
parent d475b8aff9
commit 2327f8395a

View File

@@ -56,10 +56,14 @@
</v-list-tile> </v-list-tile>
</template> </template>
</v-list>--> </v-list>-->
<v-list dense> <v-list>
<v-list-tile v-for="item in contextItems" :key="item.route" :to="item.route"> <v-list-tile
v-for="item in contextItems"
:key="item.key"
@click="$gzevent.$emit('context-click',item.key)"
>
<v-list-tile-action> <v-list-tile-action>
<v-icon>{{ "fa-" + item.icon }}</v-icon> <v-icon v-if="item.icon">{{ "fa-" + item.icon }}</v-icon>
</v-list-tile-action> </v-list-tile-action>
<v-list-tile-content> <v-list-tile-content>
<v-list-tile-title>{{ item.title }}</v-list-tile-title> <v-list-tile-title>{{ item.title }}</v-list-tile-title>
@@ -129,10 +133,10 @@ export default {
} }
], ],
contextItems: [ contextItems: [
{ title: "Click Me" }, { title: "stub view log", icon: "glasses", key: "log" },
{ title: "Click Me" }, { title: "Click Me 2", key: "2" },
{ title: "Click Me" }, { title: "Click Me 3", key: "3" },
{ title: "Click Me 2" } { title: "Click Me 4", key: "4" }
] ]
}; };
}, },
@@ -146,9 +150,12 @@ export default {
that.appBar.contextMenuItems = ctx.contextMenuItems that.appBar.contextMenuItems = ctx.contextMenuItems
? ctx.contextMenuItems ? ctx.contextMenuItems
: []; : [];
//alert("CLICK " + ctx);
}); });
this.$gzevent.$on("context-click", function(key) {
alert("context click: " + key);
});
//redirect to login if not authenticated //redirect to login if not authenticated
if (!this.$store.state.authenticated) { if (!this.$store.state.authenticated) {
this.$router.replace({ name: "login" }); this.$router.replace({ name: "login" });
@@ -160,9 +167,6 @@ export default {
}, },
logout() { logout() {
this.$store.state.authenticated = false; this.$store.state.authenticated = false;
},
stubClick() {
alert("CLICK");
} }
}, },
computed: { computed: {