Created
December 18, 2018 11:18
-
-
Save trainiac/366f53cb6e561581f54041db6ffdeac1 to your computer and use it in GitHub Desktop.
An example of defining custom route hooks in a component.
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
<script> | |
export default { | |
name: 'MyRouteComponent', | |
permissions(store, to, from) { | |
// request permissions data | |
// return a promise to resolve or reject navigation | |
}, | |
criticalData(store, to, from) { | |
// request critical data | |
// return a promise so that data can finish loading during Server Request lifecycle | |
}, | |
lazyData (store, to, from) { | |
// request lazy data | |
// no need to return a promise because nothing should wait on it | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment