|
@@ -15,7 +15,7 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
-
|
|
|
|
|
|
+
|
|
<script>
|
|
<script>
|
|
export default {
|
|
export default {
|
|
name: 'leftRightSwiperScroll',
|
|
name: 'leftRightSwiperScroll',
|
|
@@ -46,10 +46,10 @@
|
|
mounted() {
|
|
mounted() {
|
|
// 获取 HTMLCollection 转为 数组
|
|
// 获取 HTMLCollection 转为 数组
|
|
this.childrenList = [...this.$refs.swiperScrollContent.children];
|
|
this.childrenList = [...this.$refs.swiperScrollContent.children];
|
|
- console.log('childrenList--->', this.childrenList);
|
|
|
|
|
|
+ console.log('childrenList--->', this.childrenList);
|
|
console.log('swiperScroll--->', this.$refs.swiperScroll);
|
|
console.log('swiperScroll--->', this.$refs.swiperScroll);
|
|
console.log('swiperScrollContent--->', this.$refs.swiperScrollContent);
|
|
console.log('swiperScrollContent--->', this.$refs.swiperScrollContent);
|
|
-
|
|
|
|
|
|
+
|
|
// 盒子的宽度
|
|
// 盒子的宽度
|
|
this.swiperScrollWidth = this.$refs.swiperScroll.getBoundingClientRect().width;
|
|
this.swiperScrollWidth = this.$refs.swiperScroll.getBoundingClientRect().width;
|
|
// 内容的宽度
|
|
// 内容的宽度
|
|
@@ -120,15 +120,16 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
-
|
|
|
|
|
|
+
|
|
<style lang='scss' scoped>
|
|
<style lang='scss' scoped>
|
|
.left-right-swiper-scroll-box {
|
|
.left-right-swiper-scroll-box {
|
|
position: relative;
|
|
position: relative;
|
|
display: flex;
|
|
display: flex;
|
|
- width: 1230px;
|
|
|
|
|
|
+ width: 1145px;
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
transition: all 0.3s;
|
|
transition: all 0.3s;
|
|
padding: 0 30px;
|
|
padding: 0 30px;
|
|
|
|
+ margin-right: 5px;
|
|
.scroll-icon {
|
|
.scroll-icon {
|
|
position: absolute;
|
|
position: absolute;
|
|
top: 0;
|
|
top: 0;
|
|
@@ -137,6 +138,7 @@
|
|
z-index: 9;
|
|
z-index: 9;
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
background-image: linear-gradient(270deg, invalid gradient);
|
|
background-image: linear-gradient(270deg, invalid gradient);
|
|
|
|
+ z-index: 1000;
|
|
i {
|
|
i {
|
|
position: absolute;
|
|
position: absolute;
|
|
top: 5px;
|
|
top: 5px;
|
|
@@ -154,7 +156,7 @@
|
|
&.left-icon:hover{
|
|
&.left-icon:hover{
|
|
left: 0;
|
|
left: 0;
|
|
background: url("~@/assets/images/icon-arrow-left.png") 0 0 no-repeat;
|
|
background: url("~@/assets/images/icon-arrow-left.png") 0 0 no-repeat;
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
&.right-icon {
|
|
&.right-icon {
|
|
@@ -168,12 +170,12 @@
|
|
&.right-icon:hover {
|
|
&.right-icon:hover {
|
|
right: 0;
|
|
right: 0;
|
|
background: url("~@/assets/images/icon-arrow-right.png") 0 0 no-repeat;
|
|
background: url("~@/assets/images/icon-arrow-right.png") 0 0 no-repeat;
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
.swiper-scroll-content {
|
|
.swiper-scroll-content {
|
|
width: fit-content;
|
|
width: fit-content;
|
|
display: flex;
|
|
display: flex;
|
|
@@ -183,4 +185,3 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|
|
-
|
|
|