
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
vue-routisan
Advanced tools
Elegant route definitions for Vue Router. Based on Laravel routing system.

Elegant route definitions for Vue Router. Based on Laravel routing system.
You can install this package via yarn (or npm):
$ yarn add vue-routisan
The view resolver allows the view() method to automatically require components for your routes. This saves you from having repetitive imports and requires when defining routes.
The view resolver is optional. If you choose to not configure it, you can import a component and pass it directly as the 2nd parameter of the view() method.
import Route from 'vue-routisan';
Route.setViewResolver((component) => {
return require('./views/' + component).default;
});
The view() method receives the path and component route options respectively. If you defined the view resolver, you may directly specify the name of the component.
Reference: Vue route options
Route.view('/', 'Home');
import Home from './views/Home';
Route.view('/', Home);
The redirect() method receives the path and redirect route options respectively.
Route.redirect('/home', '/');
NOTE: The methods view() and redirect() both return a route instance.
The name() method sets the name option on the route instance.
Route.view('/user/profile', 'Profile').name('profile');
The guard() method sets the beforeEnter option on the route instance.
const auth = (to, from, next) => { /* must be logged in */ };
const admin = (to, from, next) => { /* user must be admin */ };
Route.view('/account/settings', 'Settings').guard(auth);
You may also provide an array of guards. They will be executed in the order they are listed in the array.
This applies not only to the guard() method, you can do this with any of the methods below that can apply navigation guards to routes.
Route.view('/admin/dashboard', 'Dashboard').guard([auth, admin]);
The children() method sets the children option on the route instance.
Route.view('/user', 'User').children(() => {
Route.view('', 'UserList');
Route.view(':id', 'UserDetails');
Route.view(':id/edit', 'UserEdit');
});
Use the options() method to set all other options on the route instance.
This method will not override the path and component options. They will be ignored if you specify them.
The children option expects a callback function instead of an array (See Nested Routes).
Reference: Vue route options
const guest = (to, from, next) => { /* already logged in */ };
Route.view('/auth/signin', 'Signin').options({
name: 'login',
beforeEnter: guest
});
beforeEnter has the alias guard for consistency with the guard() method.
Route.view('/auth/signup', 'Signup').options({
guard: guest // alias for 'beforeEnter'
});
Allows you to apply route options to multiple routes.
Route.group({ beforeEnter: guest }, () => {
Route.view('/auth/password/forgot', 'Forgot');
Route.view('/auth/password/reset', 'Reset');
});
Add a prefix to the path of each route in a group.
Route.group({ prefix: '/blog' }, () => {
Route.group({ prefix: '/posts' }, () => {
Route.view('/', 'PostIndex'); // '/blog/posts'
Route.view('/create', 'CreatePost'); // '/blog/posts/create'
Route.view('/edit', 'EditPost'); // '/blog/posts/edit'
});
});
Options such as path, redirect, alias, and prefix are automatically formatted.
Slashes will not be prepended to the paths of nested routes.
'/' // '/'
'products' // '/products'
'categories/' // '/categories'
'shop/checkout' // '/shop/checkout'
'password/change/' // '/password/change'
Route.all() returns an array of all the defined routes.
import Route from 'vue-routisan';
// define view resolver
// define routes
export default Route.all();
import Vue from 'vue';
import VueRouter from 'vue-router';
import routes from './routes';
Vue.use(VueRouter);
export default new VueRouter({
mode: 'history',
routes: routes
});
Please see CONTRIBUTING for details.
Released under the MIT License.
FAQs
Elegant route definitions for Vue Router. Based on Laravel routing system.
The npm package vue-routisan receives a total of 76 weekly downloads. As such, vue-routisan popularity was classified as not popular.
We found that vue-routisan demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.