To start our component, we will use the Vue project with Vue-CLI that we completed in the 'Creating a route alias' recipe, or we can start a new one.
To start a new one, open Terminal (macOS or Linux) or Command Prompt/PowerShell (Windows) and execute the following command:
> vue create http-project
Choose the manual features and add Router as a required feature, as indicated in the 'How to do it...' steps in the 'Creating a simple route' recipe.
Now, in these steps, we will create the router redirect rules:
- Open index.js in the src/router folder.
- Insert a new route object at the end of the routes array. This object will have two properties, path and redirect. In the path property, we need to define the path that the user will enter, '/create-new-user', and in redirect, the path that the user will be redirected to, in this case, '/user/create':
{
path: '/create-new-user',
redirect: '/user/create&apos...