vue-router-multiguard
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -28,3 +28,3 @@ function isUndefined(value) { | ||
} | ||
return (to, from, next) => { | ||
@@ -31,0 +31,0 @@ return evaluateGuards(guards, to, from, next); |
{ | ||
"name": "vue-router-multiguard", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Provides the ability to specify multiple guards for vue routes", | ||
@@ -9,5 +9,6 @@ "repository": { | ||
}, | ||
"main": "index.js", | ||
"main": "dist/vue-router-multiguard.min.js", | ||
"scripts": { | ||
"test": "mocha" | ||
"test": "mocha", | ||
"build": "webpack" | ||
}, | ||
@@ -23,4 +24,8 @@ "keywords": [ | ||
"devDependencies": { | ||
"mocha": "^3.5.0" | ||
"babel-core": "^6.26.0", | ||
"babel-loader": "^7.1.2", | ||
"babel-preset-env": "^1.6.1", | ||
"mocha": "^3.5.0", | ||
"webpack": "^3.8.1" | ||
} | ||
} |
# Vue Router Multiguard [![Build Status](https://travis-ci.org/atanas-angelov-dev/vue-router-multiguard.svg?branch=master)](https://travis-ci.org/atanas-angelov-dev/vue-router-multiguard) | ||
Provides the ability to specify multiple guards for vue routes. | ||
Provides the ability to specify multiple guards for vue router routes. | ||
@@ -24,20 +24,20 @@ ## Installing | ||
const guard1 = function(to, from, next) { | ||
console.log('guard1 called'); | ||
next(); | ||
console.log('guard1 called'); | ||
next(); | ||
} | ||
const guard2 = function(to, from, next) { | ||
console.log('guard2 called'); | ||
next(); | ||
console.log('guard2 called'); | ||
next(); | ||
} | ||
const router = new VueRouter({ | ||
routes: [ | ||
{ | ||
name: 'home', | ||
path: '/', | ||
component: {}, | ||
beforeEnter: multiguard([guard1, guard2]), | ||
} | ||
] | ||
routes: [ | ||
{ | ||
name: 'home', | ||
path: '/', | ||
component: {}, | ||
beforeEnter: multiguard([guard1, guard2]), | ||
} | ||
] | ||
}); | ||
@@ -44,0 +44,0 @@ ``` |
19167
10
158
5