Getting Started | vue router created
VueRouteristheofficialclient-sideroutingsolutionforVue.Client-sideroutingisusedbysingle-pageapplications(SPAs)totiethebrowserURLtothecontentseenbytheuser.Asusersnavigatearoundtheapplication,theURLupdatesaccordingly,butthepagedoesntneedtobereloadedfromtheserver.VueRouterisbuiltonVuescomponentsystem.YouconfigureroutestotellVueRouterwhichcomponentstoshowforeachURLpath.PrerequisitesThisguidewillassumethatyouarealreadyfamiliarwithVueitself.YoudontneedtobeaVueexpert,butyoumayoccasionallyneedtorefe...
Vue Router is the official client-side routing solution for Vue.
Client-side routing is used by single-page applications (SPAs) to tie the browser URL to the content seen by the user. As users navigate around the application, the URL updates accordingly, but the page doesnt need to be reloaded from the server.
Vue Router is built on Vues component system. You configure routes to tell Vue Router which components to show for each URL path.
Prerequisites
This guide will assume that you are already familiar with Vue itself. You dont need to be a Vue expert, but you may occasionally need to refer back to the core Vue documentation[1] for more information about certain features.
An example [2]To introduce some of the main ideas, were going to consider this example:
Lets start by looking at the root component, App.vue.
App.vue [3]vue<template> <h1>Hello App!</h1> <p> <strong>Current ro...