Skip to content

Updated README. Call next() inside vue route hook to confirm navigation #266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 4, 2018
Merged

Updated README. Call next() inside vue route hook to confirm navigation #266

merged 3 commits into from
Sep 4, 2018

Conversation

Fachher
Copy link
Contributor

@Fachher Fachher commented Sep 3, 2018

Call next() inside vue-route hooks (i.e beforeRouteEnter and beforeRouteLeave) to confirm navigation otherwise route is not rendered.

Copy link
Member

@ktsn ktsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Just commented about small tweaks.

README.md Outdated
@@ -169,12 +169,14 @@ import Component from 'vue-class-component'
class MyComp extends Vue {
// The class component now treats beforeRouteEnter
// and beforeRouteLeave as Vue Router hooks
beforeRouteEnter () {
beforeRouteEnter (to: Route, from: Route, next: Function) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove type annotations since this snippet is JavaScript.

README.md Outdated
console.log('beforeRouteEnter')
next(); // needs to be called to confirm the navigation
Copy link
Member

@ktsn ktsn Sep 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please follow existing code styling (prefer 2 spaces than hard tab, no semi-colons)

@Fachher
Copy link
Contributor Author

Fachher commented Sep 3, 2018

Fixed codereview remarks.

@ktsn ktsn merged commit 6bbafec into vuejs:master Sep 4, 2018
@ktsn
Copy link
Member

ktsn commented Sep 4, 2018

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants