Hey there, I recently started using vuejs2 with a project that is based on laravel backend. In my vuejs2 project, I wrote the following code in the file routes.js
export default new VueRouter({
routes: [{
path: '/test',
component: Test
},
{
path: '/settings',
component: Settings
},
// users
{
path: '/users/create',
component: Create
},
// end users
],
});
Now, I have a question about the line
{ path: '/users/create', component: Create}
. I'm thinking about how I can first go to a controller and then have the controller redirect me to the component. In Laravel, usually we define our routes in route.php and call a function in the controller which then redirects us to the view file. However, from what I've found, in vuejs2 I go directly to the component without going through a controller. But I need to perform certain actions before being redirected to the component. Any help or suggestions would be greatly appreciated!