首页 > 其他分享 >P9_组件-swiper和swiper-item的基本用法

P9_组件-swiper和swiper-item的基本用法

时间:2023-01-08 17:35:09浏览次数:36  
标签:color P9 list height item 组件 swiper

  1. swiper 和 swiper-item 组件的基本使用
    实现如图的轮播图效果:
    图片详情
  2. swiper 组件的常用属性
    图片详情

list.wxml

<swiper class="swiper-container" indicator-dots autoplay interval="1000" circular indicator-color="red" indicator-active-color="yellow">
<swiper-item>
<view class="item">A</view>
</swiper-item>
<swiper-item>
<view class="item">B</view>
</swiper-item>
<swiper-item>
<view class="item">C</view>
</swiper-item>
</swiper>

list.wxss

/* pages/list/list.wxss */
.swiper-container {
height: 150px;
}
.item {
height: 100%;
line-height: 150px;
text-align: center;
}
swiper-item:nth-child(1) .item {
background-color:lightgreen;
}
swiper-item:nth-child(2) .item {
background-color:lightskyblue;
}
swiper-item:nth-child(3) .item {
background-color:lightcoral;
}

标签:color,P9,list,height,item,组件,swiper
From: https://www.cnblogs.com/xiaopengmvp520/p/p9zu-jianswiper-heswiperitem-de-ji-ben-yong-fa.ht

相关文章

  • 1_使用swiper数组对象循环图片遇到的问题
    今天在练习微信小程序的swiper组件时,想用列表循环出图片,发现图片一直没出来,控制台也没有报错,后来仔细一看,原来是语法格式写错了。以下是我列表循环踩过的坑:一:微......
  • vue中form表单校验,一个form-item中有多个必填项如何操作?
    普通的正则校验就不具体写了。项目中遇到一个el-form-item含有多个input或者select,如何绑定值?   //一个form-item中有多个必填项<el-form-itemlabel="通知限......
  • FetchError: request to https://registry.npmjs.org/swiper failed, reason: connect
    安装swiper插件时,报错,经过下边方法解决后,重新安装swiper,成功! FetchError:requesttohttps://registry.npmjs.org/swiperfailed,reason:connectECONNREFUSED127.0......
  • React 用axios 获取遍历json 引入swiper轮播图
    结构展示:功能展示:1.使用swiper轮播插件,2.自动轮播,当前图片高亮小按钮首先引入swiper和配置环境1.npminstall--saveswiper2.在src文件夹index.js下引入样式,避免打包失败im......
  • MAUI新生6.2-浮出控件导航Flyout-FlyoutItem/MenuItem/Header/Footer
    如前章所述,Shell导航框架,在UI层面,有两种导航方式,一是浮出控件导航,二是底部Tab栏导航,本章节将深入学习浮出控件导航。浮出控件提供了非常丰富的定制功能,组成部分如下图所示:......
  • JavaScript学习--Item30 数组进阶全掌握
    在程序语言中数组的重要性不言而喻,JavaScript中数组也是最常使用的对象之一,数组是值的有序集合,由于弱类型的原因,JavaScript中数组十分灵活、强大,不像是Java等强类型高级语......
  • chap9 结构
    一:结构的概念   结构是C语言中一种新的构造数据类型,它能够把有内在联系的不同类型的数据汇聚成一个整体,使它们相互关联;同时,结构又是一个变量的集合,可以按照对基本......
  • Item Pipeline 的使用
    目录介绍核心方法process_item(item,spider)open_spider(self,spider)close_spider(spider)from_crawler(cls,crawler)实战介绍ItemPipeline即项目管道,它的调用发生在S......
  • Scrapy-Item Pipeline(项目管道)
     ItemPipeline(英文版):​​http://doc.scrapy.org/en/latest/topics/item-pipeline.html​​ItemPipeline(中文版):​​https://scrapy-chs.readthedocs.io/zh_CN/latest/topi......
  • Scrapy-Item Loaders(项目加载器)
     ItemLoaders:​​http://doc.scrapy.org/en/latest/topics/loaders.html​​ItemLoaders(中文版):​​https://scrapy-chs.readthedocs.io/zh_CN/latest/topics/loaders.htm......