Swiper中文论坛
标题:
如何结合el-menu使用
[打印本页]
作者:
学习交流
时间:
2019-8-4 07:52
标题:
如何结合el-menu使用
请教如何结合 el-menu来使用?
<
swiper
:
options
=
"
swiperOption
"
>
<el-menu class="el-menu-demo swiper-wrapper" mode="horizontal">
<el-menu-item v-for="o in swiperSlides" :key="o" index="1">菜单{{o}}</el-menu-item>
</el-menu>
</
swiper
>
swiperOption:
{
slidesPerView:
'auto'
,
navigation:
{
nextEl:
'.swiper-next'
,
prevEl:
'.swiper-prev'
}
},
作者:
学习交流
时间:
2019-8-6 07:18
我用这个方法解决了,不知道有无更好的方法:
<el-col style="width:calc(100% - 430px);display:flex">
<div class="swiper-prev">
<transition name="el-fade-in-linear">
<i v-show="showLeftArr" class="el-icon-arrow-left"></i>
</transition>
</div>
<div style="overflow:hidden">
<el-menu class="swiper-wrapper menu-top" mode="horizontal" @select="handleMenuClick">
<swiper ref="menuSwiper" :options="swiperOption">
<el-menu-item v-for="(item,index) in menuList" class="swiper-slide" :index="index.toString()" :key="item.id">{{item.name}}</el-menu-item>
</swiper>
</el-menu>
</div>
<div class="swiper-next">
<transition name="el-fade-in-linear">
<i v-show="showRightArr" class="el-icon-arrow-right"></i>
</transition>
</div>
</el-col>
复制代码
欢迎光临 Swiper中文论坛 (http://bbs.swiper.com.cn/)
Powered by Discuz! X3.2