I have created a login using Firebase, Vue.js and Vuex for Twitter Authentication. Here is the code. The user can login with their Twitter account successfully.I want to incorporate the login with a bootstrap dashboard template. Essentially I want the user to login in to the dashboard on 'User Profile (stats)".This may be a simple routing fix but I am new to node and very confused and stressed over it as both the main.js pages are different and the dashboard has 2 routing files. Can someone take a look and help me out? This would mean a lot to me. Thank you!This is the template code.main.jsimport Vue from "vue"; import App from "./App"; import router from "./router/index"; import PaperDashboard from "./plugins/paperDashboard"; import "vue-notifyjs/themes/default.css"; Vue.use(PaperDashboard); /* eslint-disable no-new */ new Vue({ router, render: h => h(App) }).$mount("#app"); routes.jsimport DashboardLayout from "@/layout/dashboard/DashboardLayout.vue"; // GeneralViews import NotFound from "@/pages/NotFoundPage.vue"; // Admin pages import Dashboard from "@/pages/Dashboard.vue"; import UserProfile from "@/pages/UserProfile.vue"; //I recognise that SignIn has to be imported and have / as it's path const routes = [ { path: "/", component: DashboardLayout, redirect: "/dashboard", children: [ { path: "dashboard", name: "dashboard", component: Dashboard }, { path: "stats", name: "stats", component: UserProfile }, ] }, { path: "*", component: NotFound } ]; /** * Asynchronously load view (Webpack Lazy loading compatible) * The specified component must be inside the Views folder * @param {string} name the filename (basename) of the view to load. function view(name) { var res= require('../components/Dashboard/Views/' + name + '.vue'); return res; };**/ export default routes; index.jsimport Vue from "vue"; import VueRouter from "vue-router"; import routes from "./routes"; Vue.use(VueRouter); // configure router const router = new VueRouter({ routes, // short for routes: routes linkActiveClass: "active" }); export default router;
Submitted February 20, 2020 at 02:25PM by RyboXBL
No comments:
Post a Comment