How to use uni-simple-router - 2 common examples

To help you get started, we’ve selected a few uni-simple-router examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SilurianYang / uni-simple-router / examples / common / uni-app-router / useRouter.js View on Github external
return {
						name
					};
				}
				return {
					name: '404'
				}
			}
		}
	]
}
if (routesConfig.h5.vueRouterDev) {
	routesConfig.routes = vueDevRoutes;
}

const router = new Router(routesConfig);


const whitelist = {
	'/pages/tabbar/tabbar-1/tabbar-1': 'tabbar-1',
	'/pages/tabbar/tabbar-2/tabbar-2': 'tabbar-2',
	'/pages/tabbar/tabbar-3/tabbar-3': 'tabbar-3',
	'/pages/tabbar/tabbar-4/tabbar-4': 'tabbar-4',
	'/pages/tabbar/tabbar-5/tabbar-5': 'tabbar-5'
}

let count =0;

router.beforeEach((to, from, next) => {
	console.log(to)
	console.log(from)
	next();
github SilurianYang / uni-simple-router / examples / common / uni-app-router / useRouter.js View on Github external
return {
						name
					};
				}
				return {
					name: '404'
				}
			}
		}
	]
}
if (routesConfig.h5.vueRouterDev) {
	routesConfig.routes = vueDevRoutes;
}

const router = new Router(routesConfig);


const whitelist = {
	'/pages/tabbar/tabbar-1/tabbar-1': 'tabbar-1',
	'/pages/tabbar/tabbar-2/tabbar-2': 'tabbar-2',
	'/pages/tabbar/tabbar-3/tabbar-3': 'tabbar-3',
	'/pages/tabbar/tabbar-4/tabbar-4': 'tabbar-4',
	'/pages/tabbar/tabbar-5/tabbar-5': 'tabbar-5'
}

let count =0;

router.beforeEach((to, from, next) => {
	console.log(to)
	console.log(from)
	next();

uni-simple-router

> 一个更为简洁的[Vue-router](https://router.vuejs.org/zh/),专为 [uni-app](https://uniapp.dcloud.io/) 量身打造

MIT
Latest version published 3 years ago

Package Health Score

51 / 100
Full package analysis

Popular uni-simple-router functions