02微信小程序-轮播的宽度100%显示和轮播的基础配置

简介: 02微信小程序-轮播的宽度100%显示和轮播的基础配置

1==》如何让轮播的宽度100%显示?


你先给swiper 外面添加一个大盒子,给大盒子一个类 。


<view class='lunbobox'>


然后wxss 里面设置 image , width: 100%; 在设置大盒子的宽度 width: 100%; 这样就可以了.


<view class='lunbobox'>
  <!-- 轮播开始 -->
  <swiper  indicator-dots="{{indicatorDots}}"
  circular
  autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}">
  <block wx:for="{{imgUrls}}">
    <swiper-item>
      <image src="{{item}}" class="slide-image" width="750" height="150"/>
    </swiper-item>
  </block>
</swiper>
<!-- end -->
</view>


设置盒子的宽度 图片的宽度 让图片100%显示


.lunbobox{
  width: 750rpx;
}
.slide-image{
  width: 100%;
}


2==》轮播的基础配置项


circular表示是否衔接  后面不要加true哦


 <swiper  indicator-dots="{{indicatorDots}}"
  circular
  autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}">
  <block wx:for="{{imgUrls}}">
    <swiper-item>
      <image src="{{item}}" class="slide-image" width="750" height="150"/>
    </swiper-item>
  </block>
</swiper>
// 轮播
imgUrls: [
  'https://images.unsplash.com/photo-1551334787-21e6bd3ab135?w=750',
  'https://images.unsplash.com/photo-1551214012-84f95e060dee?w=750',
  'https://images.unsplash.com/photo-1551446591-142875a901a1?w=750'
],
indicatorDots: true, //是否显示小圆点  true显示
autoplay: true,     //是否自动播放  true自动播放
interval: 5000,     //播放的间隔
duration: 1000,      //滑 动动画时长

03==》跳转使用


它在导航里面的哦  <navigator></navigator>


navigator标签类似于a标签,它里面是可以包含view标签的



04==》如何循环三个导航链接


ps: wx:for="{{labs}}" 循环的语法 labs是被循环的数组  注意有双引号  item是循环的每一项  


 <navigator url="../list/list" hover-class="navigator-hover" wx:for="{{labs}}">
    <view>{{item.title}}</view>
 </navigator>
// 导航链接的数据
labs: [{ id: 1, title: "haha1" }, { id: 3, title: "haha2" }, { id: 3, title: "haha3" }]


05==》css3 一个在最左最右 /* 导航 */


.daohangbox{
display: flex;
justify-content: space-between; //巧记两者之间 between说明一个在左一个在右
}


相关文章
|
12天前
|
JSON 小程序 数据格式
微信小程序的tabbar怎么配置
微信小程序的tabbar怎么配置
23 2
|
1月前
|
小程序 开发工具 git
【微信小程序】-- uni-app 项目--- 购物车 -- 配置 tabBar 效果(五十一)
【微信小程序】-- uni-app 项目--- 购物车 -- 配置 tabBar 效果(五十一)
|
1月前
|
开发框架 移动开发 小程序
【微信小程序】-- 配置uni-app的开发环境(四十八)
【微信小程序】-- 配置uni-app的开发环境(四十八)
|
11天前
微信登陆报错:redirect_uri域名与后台配置不一致,错误码:10003 微信支付报错 微信登录报错 微信开发
微信登陆报错:redirect_uri域名与后台配置不一致,错误码:10003 微信支付报错 微信登录报错 微信开发
|
20天前
|
JSON 小程序 安全
微信小程序介绍、账号申请、开发者工具目录结构详解及小程序配置
微信小程序介绍、账号申请、开发者工具目录结构详解及小程序配置
|
1月前
|
小程序 Windows
【微信小程序】全局配置和windows节点常用配置
【微信小程序】全局配置和windows节点常用配置
36 1
|
1月前
|
小程序
微信小程序——属性配置大全
微信小程序——属性配置大全
34 0
|
1月前
|
JSON 小程序 搜索推荐
【微信小程序】-- 模板语法与配置的总结(二十一)
【微信小程序】-- 模板语法与配置的总结(二十一)
|
22天前
|
小程序 API 数据安全/隐私保护
微信小程序开发中的一些常用标签
这些标签是微信小程序开发中的基础,开发者可以根据需要组合使用这些标签来构建小程序的界面。每个标签都有其属性和事件,可以通过属性来调整组件的样式和行为,通过事件来响应用户的操作。
43 5
|
9天前
|
小程序 JavaScript Java
基于SpringBoot+Vue+uniapp微信小程序的外卖小程序的研究与开发的详细设计和实现
基于SpringBoot+Vue+uniapp微信小程序的外卖小程序的研究与开发的详细设计和实现
12 0