zoukankan      html  css  js  c++  java
  • 微信小程序开发笔记(四)--轮播图

    官方传送门

    wxml:

    <!--pages/index/index.wxml-->
    <swiper circular="{{circular}}" indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" indicator-color="{{indicatorColor}}" indicator-active-color="{{indicatorActiveColor}}">
        <block wx:for="{{imgUrls}}">
            <swiper-item>
                <image src="{{item.img_path}}"></image>
            </swiper-item>
        </block>
    </swiper>

    js:

    // pages/index/index.js
    Page({
    
      /**
       * 页面的初始数据
       */
      data: {
        circular: true, //是否开启无限轮播,衔接
        indicatorDots: true, //是否显示面板指示点
        autoplay: true, //是否自动播放
        interval: 3000, //自动切换时间间隔
        duration: 1000, //滑动动画时长
        indicatorColor: "#eee", //普通轮播点背景色
        indicatorActiveColor: "#f10215", //选中轮播点背景色
        imgUrls: [{
            'img_path': '/images/swiper.png'
          },
          {
            'img_path': '/images/swiper.png'
          },
          {
            'img_path': '/images/swiper.png'
          },
        ],
      },
    
    })
    一辈子很短,努力的做好两件事就好;第一件事是热爱生活,好好的去爱身边的人;第二件事是努力学习,在工作中取得不一样的成绩,实现自己的价值,而不是仅仅为了赚钱。
  • 相关阅读:
    redis乐观锁
    redis
    解决创建Redis容器没有conf配置文件
    redis缓存配置
    Docker架构
    Flask获取数据的一些方法
    Nginx正向代理、反向代理与负载均衡
    Sanic
    Dockerfile详解
    Centos7上安装docker
  • 原文地址:https://www.cnblogs.com/antao/p/12624126.html
Copyright © 2011-2022 走看看