From 274551f2eaf6651a782162b48bd073b14ab35d86 Mon Sep 17 00:00:00 2001 From: "fachher.syed" Date: Mon, 3 Sep 2018 15:10:45 +0200 Subject: [PATCH 1/3] Updated README. Call next() inside vue route hook to confirm navigation --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 68d48c7..b2dbd6c 100644 --- a/README.md +++ b/README.md @@ -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) { console.log('beforeRouteEnter') + next(); // needs to be called to confirm the navigation } - beforeRouteLeave () { - console.log('beforeRouteLeave') + beforeRouteLeave (to: Route, from: Route, next: Function) { + console.log('beforeRouteLeave'); + next(); // needs to be called to confirm the navigation } } ``` From 65db5f41f0e15fd51591eab76389353bdac9d34a Mon Sep 17 00:00:00 2001 From: "fachher.syed" Date: Mon, 3 Sep 2018 19:09:44 +0200 Subject: [PATCH 2/3] Fixed codereview remarks --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b2dbd6c..ccc25ff 100644 --- a/README.md +++ b/README.md @@ -169,14 +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 (to: Route, from: Route, next: Function) { + beforeRouteEnter (to, from, next) { console.log('beforeRouteEnter') - next(); // needs to be called to confirm the navigation + next(); // needs to be called to confirm the navigation } - beforeRouteLeave (to: Route, from: Route, next: Function) { + beforeRouteLeave (to, from, next) { console.log('beforeRouteLeave'); - next(); // needs to be called to confirm the navigation + next(); // needs to be called to confirm the navigation } } ``` From 2438388ad8dca7881080c05d4e154c908b2523ad Mon Sep 17 00:00:00 2001 From: katashin Date: Tue, 4 Sep 2018 09:26:18 +0900 Subject: [PATCH 3/3] docs: remove semi-colons --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ccc25ff..7113dbb 100644 --- a/README.md +++ b/README.md @@ -171,12 +171,12 @@ class MyComp extends Vue { // and beforeRouteLeave as Vue Router hooks beforeRouteEnter (to, from, next) { console.log('beforeRouteEnter') - next(); // needs to be called to confirm the navigation + next() // needs to be called to confirm the navigation } beforeRouteLeave (to, from, next) { - console.log('beforeRouteLeave'); - next(); // needs to be called to confirm the navigation + console.log('beforeRouteLeave') + next() // needs to be called to confirm the navigation } } ``` pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy