import Vue from "vue"
import Router from" vue-router"
/ Test /
import Demo from"@ / pages/demo/Demo"
/ Home /
import Home from"@ / pages/home/Home"
/ Investment list /
import Invet from"@ / pages/invet/Invet"
import InvetA from"@ / pages/invet/InvetA"
import InvetB from"@ / pages/invet/InvetB"
import InvetC from"@ / pages/invet/InvetC"
import InvetD from"@ / pages/invet/InvetD"
import InvetDall from"@ / pages/invet/InvetDall"
import InvetDzq from"@ / pages/invet/InvetDzq"
import InvetDzz from"@ / pages/invet/InvetDzz"
/ Investment details /
import Detal From"@ / pages/detal/Detal"
/ my /
import My from"@ / pages/my/My"
/ sign in /
import Login from"@ / pages/Login"
import Register from"@ / pages/Register"
Vue.use (Router)
const router= new Router ({
mode: "history",
routes: [
{
path: "/",
redirect: "/home"
},
{
path: "/home",
name: "Home",
component: Home,
meta:{
title:""
}
},
{
path: "/invet",
name: "Invet",
component: Invet,
redirect:"/invet/InvetA",
meta:{
title:""
},
children: [
{
path: "/invet/InvetA",
name: "InvetA",
component: InvetA,
meta:{
title:"A"
},
},
{
path: "/invet/InvetB",
name: "InvetB",
component: InvetB,
meta:{
title:"B"
},
},
{
path: "/invet/InvetC",
name: "InvetC",
component: InvetC,
meta:{
title:"C"
},
},
{
path: "/invet/InvetD",
name: "InvetD",
component: InvetD,
//redirect:"/invet/InvetDall",
meta:{
title:"D"
},
children: [
{
path: "/invet/InvetDall",
name: "InvetDall",
component: InvetDall,
meta:{
title:"D"
}
},
{
path: "/invet/InvetDzq",
name: "InvetDzq",
component: InvetDzq,
meta:{
title:"D"
}
},
{
path: "/invet/InvetDzz",
name: "InvetDzz",
component: InvetDzz,
meta:{
title:"D"
}
}
]
}
]
},
{
path: "/detal",
name: "Detal",
component: Detal,
meta:{
title:""
}
},
{
path: "/my",
name: "My",
component: My,
meta:{
title:""
}
},
{
path: "/login",
name: "Login",
component: Login,
meta:{
title:""
}
},
{
path: "/register",
name: "Register",
component: Register,
meta:{
title:""
}
}
]
})
router.beforeEach ((to, from, next) = > {
document.title = to.meta.title
next ()
})
export default router
http://127.0.0.1/detal