Skip to content

Instantly share code, notes, and snippets.

@jrgleason
Created January 31, 2019 23:52
Show Gist options
  • Save jrgleason/9954ef7c5f3538857edd2c5cf33bee8f to your computer and use it in GitHub Desktop.
Save jrgleason/9954ef7c5f3538857edd2c5cf33bee8f to your computer and use it in GitHub Desktop.
const routes = [
{
path: '/',
component: Main
},
{
path: '/enterprise',
component: Enterprise
}
];
const router = new VueRouter({
mode: "history",
routes: routes
});
window.app = new Vue({
router,
render: function (createElement) {
return createElement(Viewport)
}
})
import 'vue-material/dist/vue-material.css'
import 'vue-material/dist/theme/default-dark.css'
export default {
data:()=>({
message: "Now it is for real",
title: "Jackie R. Gleason",
menuVisible: false
}),
methods: {
toggleMenu () {
this.menuVisible = !this.menuVisible
}
},
beforeRouteLeave(to, from, next){
console.log("Event called");
this.menuVisible = false;
}
}
<template src="./Viewport.html">
</template>
<script src="./Viewport.js">
</script>
<style src="./Viewport.css">
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment