🐱🐉🐱🐉🐱🐉 请乘理想之马,挥鞭从此起程,路上春色正好,天上太阳正晴🐾🐾🐾
🌈博客主页👉白小筠
实现效果:
实现步骤:
list.wxml
A
B
C
编辑样式在list.wxss
.container1 view{
width: 100px;
height: 100px;
text-align: center;
line-height: 100px;
}
.container1 view:nth-child(1){
background-color: limegreen;
}
.container1 view:nth-child(2){
background-color: lightblue;
}
.container1 view:nth-child(3){
background-color: lightpink;
}
.container1{
/* 横向对齐 */
display: flex;
justify-content: space-around;
}
效果展示:
实现步骤:
1、设置scroll-y="true“
A
B
C
2、设置高度
需要设置高度,要不然页面不会显示滚动条
.container1{
border: 1px solid red;
width: 100px;
height: 120px;
}
A
B
C
样式
.swiper-container{
height: 150px;
}
.item{
height: 100%;
line-height: 150px;
text-align: center;
}
swiper-item:nth-child(1) .item{
background-color: lightblue;
}
swiper-item:nth-child(2) .item{
background-color: red;
}
swiper-item:nth-child(3) .item{
background-color: seashell;
}
1、indicator-dots属性
让轮播图出现小点
效果展示:
2、indicator-color指示点颜色
效果展示
3、indicator-active-color被激活的小圆点的颜色
4、autoplay:自动切换默认5秒
5、interval 自定义切换时间
6、circulars是否采用衔接滑动
需要使用真机调试查看效果
手机号支持长按选中效果
13800005056
效果展示:
通过type指定按钮类型
通过size属性指定按钮的大小
通过plain设置镂空按钮
效果展示:
图片组件
image{
border: 1px solid;
}
image组件中通过model属性指定图片的裁剪和缩放模式,常用的model下属性如下
name | function |
---|---|
scaleToFill | 宽高同时拉伸,填充满整个image |
aspectFit | 以最长边为准进行缩放,显示出整个图片 |
aspectFitll | 以最短边为准进行缩放,显示去掉长边不在比例内部分后的图片 |
heightFix | 高度不变,宽度自动变化,保持原图宽高比不变 |
widthFix | 宽度不变,高度自动变化,保持原图宽高比例 |