vue中的横向排列_vue.js 首页PC端横排导航栏

先看看效果

export default{

data(){

return{

nowIndex:0,

items:[

{

name:‘首页‘,

isSubShow:false,

subItems:[

]

},

{

name:‘精选路线‘,

isSubShow:false,

subItems:[

{

name:‘马尔代夫‘

},

{

name:‘索马里海峡‘

},

{

name:‘丽江/昆明‘

},

{

name:‘天安门/故宫‘

}

]

}

,

{

name:‘关于我们‘,

isSubShow:false,

subItems:[

{

name:‘企业简介‘

},

{

name:‘未来规划‘

},

{

name:‘企业动态‘

}

]

},

{

name:‘旅游攻略‘,

isSubShow:false,

subItems:[

{

name:‘热门攻略‘

},

{

name:‘经济攻略‘

},

{

name:‘青年攻略‘

},

{

name:‘老年攻略‘

},

{

name:‘吃货必看‘

}

]

},

{

name:‘定制旅游‘,

isSubShow:false,

subItems:[

{

name:‘普通定制‘

},

{

name:‘豪华专线‘

},

{

name:‘情侣必备‘

}

]

}

]

}

},

methods:{

selectStyle:function(item){

item.isSubShow = true

},

outStyle(item){

item.isSubShow = false

}

}

}

.nav{width:100%;height: 50px;background: #48B246;}

.nav .nav-centent{width: 1200px;margin:0 auto;height: 50px;}

.nav .nav-centent > li{width: 120px;height: 50px;display: block;float: left;text-align: center;margin-right: 20px;position: relative;cursor: pointer;}

.nav .nav-centent li a{width: 120px;height: 50px;display: block;font-size: 18px;line-height: 50px;color: #fff;}

.nav .nav-centent ul{position: absolute;left: 0;top: 50px;z-index: 99;width: 100%;}

.nav .nav-centent ul li{width: 120px;height: 50px;display: block;float: left;text-align: center;margin-right: 20px;line-height: 50px;background: #46B148;}

.nav .nav-centent ul li a:hover{background: #fff;color:#48B246; }

.nav .nav-centent li a:hover{background: #fff;color:#48B246; }

.nav .nav-centent li a.on{background: #fff;color:#48B246; }

刚开始学,写的不好请大神不要喷我。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值