From 499b77e481d9aa7a6dd2f84c540ce5159b834a8d Mon Sep 17 00:00:00 2001 From: duqingquan Date: Fri, 30 Jun 2023 20:18:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85swiper=20=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/component/swiper/swiper.uvue | 63 +++++++++++++++++++++++++++--- 1 file changed, 58 insertions(+), 5 deletions(-) diff --git a/pages/component/swiper/swiper.uvue b/pages/component/swiper/swiper.uvue index 5dd1eb65..3c389646 100644 --- a/pages/component/swiper/swiper.uvue +++ b/pages/component/swiper/swiper.uvue @@ -2,7 +2,7 @@ - + A @@ -14,6 +14,30 @@ + + + 是否显示面板指示点 + + + + 是否自动切换 + + + + 是否循环 + + + 间隔时间 + + + + + 定制指示器颜色 + + + + + @@ -23,14 +47,42 @@ data() { return { background: ['color1', 'color2', 'color3'], - indicatorDots: true, - autoplay: true, interval: 2000, - duration: 500 + dotsSelect:false, + autoplaySelect:false, + circularSelect:false, + indicatorColorSelect:false, + intervalSelect:1000, + indicatorColor:"", + indicatorColorActive:"", } }, methods: { - + dotsChange: function (e : SwitchChangeEvent) { + this.dotsSelect = e.detail.value + }, + autoplayChange: function (e : SwitchChangeEvent) { + this.autoplaySelect = e.detail.value + }, + circularChange: function (e : SwitchChangeEvent) { + this.circularSelect = e.detail.value + console.log(this.circularSelect) + }, + sliderChange(e : SliderChangeEvent) { + this.intervalSelect = e.detail.value + }, + indicatorColorChange(e : SwitchChangeEvent) { + this.indicatorColorSelect = e.detail.value + if(this.indicatorColorSelect){ + // 选择了定制指示器颜色 + this.indicatorColor = "#ff00ff" + this. indicatorColorActive = "#0000ff" + }else{ + // 没有选择颜色 + this.indicatorColor = "" + this. indicatorColorActive = "" + } + } } } @@ -44,6 +96,7 @@ height: 300rpx; } .swiper-item { + width: 100%; height: 300rpx; line-height: 300rpx; text-align: center; -- GitLab