Я создал логин, используя Firebase, Vue. js и Vuex для аутентификации в Twitter. Вот код Пользователь может успешно войти в свою учетную запись Twitter.
Я хочу включить регистрацию в шаблон панели инструментов bootstrap. По сути, я хочу, чтобы пользователь выполнил вход в панель управления «Профиль пользователя (статистика)».
Это может быть простое исправление маршрутизации, но я новичок в узле и очень смущен и расстроен из-за того, что оба основных . js страницы разные, и на панели инструментов есть 2 файла маршрутизации. Может кто-нибудь взглянуть и помочь мне? Это будет много значить для меня. Спасибо!
Это код шаблона.
основной. js
import 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");
маршруты. js
import 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;
индекс. js
import 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;