码迷,mamicode.com
首页 > 其他好文 > 详细

1.3_视图容器_swiper

时间:2020-06-04 01:27:29      阅读:81      评论:0      收藏:0      [点我收藏+]

标签:export   color   ati   mamicode   def   lis   swipe   swiper   int   

图:

技术图片

 代码:

<template>
    <view>
        <view>
            <swiper class="swiper" circular :indicator-dots="indicatorDots"
                    :autoplay="true" :interval="3000" :duration="1000">
                <swiper-item v-for="(item,index) in vList">
                    <view class="swiper-item" :style="{background:cList[index]}">{{item}}</view>
                </swiper-item>
            </swiper>
        </view>
        <view @tap=changeDots>
            点击切换切换显示原点
        </view>
    </view>
</template>

<script>
    export default {
        data() {
            return {
                vList:["a","b","c"],
                cList:["#007AFF","#CE3C39","#FFB400"],
                indicatorDots: true,
            }
        },
        onLoad() {

        },
        methods: {
            changeDots(){
                this.indicatorDots = !this.indicatorDots;
            }
        }
    }
</script>

<style>
    .swiper{
        height: 300rpx;   /* 默认高度 */
    }
    .swiper-item{
        display: block;
        height: 300rpx;   /* 轮播图高度 */
        line-height: 300rpx;
        text-align: center;
    }
</style>

1.3_视图容器_swiper

标签:export   color   ati   mamicode   def   lis   swipe   swiper   int   

原文地址:https://www.cnblogs.com/luwei0915/p/13040943.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!