Question 15
Consider the following Vue router configuration.
const routes = [ { path: '/admin', component: Admin }, { path: '/unauthorized', component: Unauthorized },];
const router = new VueRouter({ routes });
new Vue({ el: '#app', data: { userRole: 'user' }, mounted() { if (this.userRole !== 'admin') { this.$router.push('/unauthorized'); } else { this.$router.push('/admin'); } }, router});If the app loads with userRole = 'user', what will be displayed?
Admin component
Unauthorized component
Blank screen
Vue throws a routing error