是否可以在路由器配置内的beforeEach()中使用$ vuetify.breakpoint?
Vue.use(Router);
const router = new Router({
mode: MODES.history,
base: process.env.BASE_URL,
routes: [path1, path2, something]
});
router.beforeEach((to, from, next) => {
if ($vuetify.breakpoint.name === 'xs') {
next({ path: "/something" });
} else {
next();
}
});
export default router;