vue路由+子路由+具名路由demo例項(結合animate.css動畫)
阿新 • • 發佈:2019-02-17
const Index = {
template:"#index"
}
const List = {
template:"#list",
data(){
return{
items:[
{
text:'美女',
url:'http://t.cn/RajyIIE' ,
},
{
text:'野獸',
url:'http://t.cn/RasDspD',
},
{
text:'性感',
url:'http://t.cn/Rask2ST'
}
]
}
}
}
const Detail = {
template:"#detail",
data(){
return{
isShow:false
}
},
mounted(){
this.isShow = true
}
}
const Footer = {
template:"#footer"
}
let router = new VueRouter({
routes:[
{
path:'/',
components:{
shit:Index,
default:List
}
},
{
path:'/list',
name:'list',
component:List,
'children':[
{
path:':rp',
name:'list.rp',
components:{
shit2:Detail,
default:Footer
}
}
]
},
{
path:'*',
component:Index
}
]
});
new Vue({
router,
el:"#box"
})