默认自动播放,进入轮播图片或按钮取消播放,按钮以及圆点进行切换图片
<style lang="scss" scoped>
.banner {
width: 260px;
margin-left: 20px;
overflow: hidden;
border: 1px solid red;
.list {
width: 2000%;
margin-top: 28px;
text-align: left;
overflow: hidden;
position: relative;
.item {
display: inline-block;
vertical-align: middle;
width: 230px;
height: 100px;
padding-right: 30px;
.item-img {
width: 100%;
height: 100%;
cursor: pointer;
border: 1px solid #ccc;
.img {
display: block;
width: 100%;
height: 100%;
border: 1px solid #ccc;
}
}
}
}
.warp-dots{
text-align: center;
.dots-item{
display: inline-block;
width: 5px;
height: 5px;
margin: 0 2px;
background-color: #000;
border-radius: 50%;
cursor: pointer;
&.active{
background-color: #19b9e7;
}
}
}
}
</style>
<template>
<div
class="banner"
ref="bannerRef"
@mouseenter="bannerEnter"
@mouseleave="bannerLeave">
<ul class="list" ref="listRef" :style="listStyle">