<! DOCTYPEHTML> <HTMLlang="en"> <Head> <Metacharset="UTF-8"> <title>vue-router</title> <Linkrel="stylesheet"href="Http://cdn.bootcss.com/bootstrap/3.2.0/css/bootstrap.min.css"> <Scriptsrc="Js/vue.js"></Script> <!---The first step, introduce the source code of Vue-router into---> <Scriptsrc="js/Vue-router.js" ></Script> </Head> <Body> <Divid="App"> <Divclass="Container"> <ulclass="Nav nav-pills"> <!---use Router-link to jump---> <Li><Router-linkto="/index/i"> Home </Router-link></Li> <Li><Router-linkto="/index/b"> Book List </Router-link></Li> <Li><Router-linkto="/index/g"> Games List </Router-link></Li> </ul> <Div> <Router-view></Router-view> </Div> </Div> </Div> <Script>/** * Configuring Routes, using the official Vuerouter * New Vuerouter to get an instance of Vuerouter * passing parameters in Vuerouter (object) * There is a rou in the argument TES Array Properties * This array is an array of objects * Each object is a route state */varRouter=NewVuerouter({Routes: [
{Path:"/index",Component: {Template:'//Here with anti (single quote) can have code reminders can also use normal single quotes <div><router-view></router-view> </div> ` Template: "<div><router-view></router-view></div>" another way of writing },Children: [
{Path:"I",Component: {Template:" }
},
{Path:"B",Component: {Template:" }
},
{Path:"G",Component: {Template:" }
}
]
}
]
});NewVue({Data: {username:"Andy Lau" },Router:Router }). $mount ("#app"); </Script> </Body> </HTML>