Skip to main content

Posts

Showing posts with the label Vue Router

An Introduction On VueJs 3.0 Vue Router

In this article, we are going to understand the basic concept of routing in the VueJS 3.0 application. Create A VueJS 3.0 Sample Application: Let's understand routing concepts by doing a sample VueJS 3.0 application, so as a first step create a sample application. Command To Install Vue CLI Globally On Your System npm run -g @vue/cli Command To Create Vue App: vue create your_app_name The vue-router available as a separate library, so to install it run the following command. Command To Install Vue Router Library(For Vue3.0) npm install vue-router@4 After successfully installing the route library we can observe the route library reference in the package.json file. Create Vue Components: Let's create sample components like 'Home' and 'About'. We will load this component based on a route like pages. src/components/Home.vue: <template> <div> My Home Page </div> </template> <script> export default { } </sc