Created
January 31, 2019 23:52
-
-
Save jrgleason/9954ef7c5f3538857edd2c5cf33bee8f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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