router.js
import Vue from "vue";
import Router from "vue-router";
import Home from "./views/Home.vue";
import Chatroom from "./views/chatroom/index.vue";
Vue.use(Router);
export default new Router({
routes: [
{
path: "/",
name: "home",
component: Home
},
{
path: "/chatroom",
name: "chatroom",
component: Chatroom
}
]
});