4👍
You can use Vue router library. Here, components is the folder where vue components are added. The variable "path" refers to the url route.
This is a sample router file I created.
import Vue from "vue";
import Router from "vue-router";
Vue.use(Router);
export default new Router({
routes: [
{
path: "/",
component: () => import("@/components/Login"),
},
{
path: "/home",
name : "home",
component: () => import("@/components/Home"),
},
]
});
Please refer this document : https://v2.vuejs.org/v2/guide/routing.html
Also, import your router file into app initialisation.
import router from "./router";
new Vue({
router,
render: h => h(App)
}).$mount("#app");
- [Vuejs]-Command 'vue' not found, did you mean: command 'vpe' from deb texlive-latex-extra Try: sudo apt install <deb name> on UBUNTU
- [Vuejs]-VueJs v-bind:type on input element not working not working when using type as property name
Source:stackexchange.com