Laravel 如何在vue中共享双组件仪表板和登录页
我正在尝试用laravel和vue创建一个SPA,我有两个页面1)仪表板2)着陆page 我制作了路由器vue和应用程序,但它在仪表板页面内有登录页 例如 http://localhost:8000/landing 在 http://localhost:8000/dashboard 怎么把它分开Laravel 如何在vue中共享双组件仪表板和登录页,laravel,vue.js,vue-component,vue-router,router,Laravel,Vue.js,Vue Component,Vue Router,Router,我正在尝试用laravel和vue创建一个SPA,我有两个页面1)仪表板2)着陆page 我制作了路由器vue和应用程序,但它在仪表板页面内有登录页 例如 http://localhost:8000/landing 在 http://localhost:8000/dashboard 怎么把它分开 So I am using vue-router in Laravel 7with bootstrap 5 app. hom.blade.php 在这里输入代码 app.js wind
So I am using vue-router in Laravel 7with bootstrap 5 app.
hom.blade.php
在这里输入代码
app.js
window.Vue=require(“Vue”);
从“/routes”导入路由器;
从“./App.vue”导入应用程序
从“vue路由器”导入VueRouter;
Vue.use(VueRouter);
从“Vue”导入Vue;
const app=新的Vue({
路由器,
渲染:h=>h(应用程序),
}).$mount(“#应用程序”)
路由器.js
从“Vue”导入Vue;
从“vue路由器”导入VueRouter;
Vue.use(VueRouter);
常量路由器=新的VueRouter({
模式:“历史”,
路线:[
{
路径:“/landing”,
名称:“登陆”,
组成部分:着陆,
},
{
名称:“仪表板”,
路径:“/dashboard”,
组件:仪表板,
}
]
});
导出默认路由器;
如何在不包含两个组件的情况下将每个页面放在单独的路径中?
hom.blade.php
<body>
<div id="app"></div>
<App></App>
</body>
enter code here
app.js
window.Vue = require("vue");
import router from "./routes";
import App from './App.vue'
import VueRouter from "vue-router";
Vue.use(VueRouter);
import Vue from "vue";
const app = new Vue({
router,
render: h => h(App),
}).$mount('#app')
router.js
import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);
const router = new VueRouter({
mode: "history",
routes: [
{
path: "/landing",
name: "landing",
component: Landing,
},
{
name: "dashboard",
path: "/dashboard",
component: Dashboard,
}
]
});
export default router;
how can get every page in a separate path without comined tow component?