当前位置:网站首页>常用的视图容器类组件
常用的视图容器类组件
2022-07-05 20:19:00 【'wx】
1view
普通视图区域
类似于html中的div,是一个块级元素
常用来实现页面的布局效果
<view>
我是view
</view>2.scroll-view
可滚动的视图区域
常用来实现滚动列表效果
<scroll-view class="container" scroll-y>
<view>A</view>
<view>B</view>
<view>C</view>
</scroll-view>3.swiper和swiper-item
轮播图容器组件和轮播图item组件
<swiper class="swiper-container" indicator-dots="true" indicator-color="pink" indicator-active-color="orange" autoplay interval="1000" circular="true">
<swiper-item>
<view class="item">item1</view>
</swiper-item>
<swiper-item>
<view class="item">item2</view>
</swiper-item>
<swiper-item>
<view class="item">item3</view>
</swiper-item>
</swiper>swiper组件常用属性
属性 | 类型 | 默认值 | 说明 |
indicator-dots | boolean | false | 是否显示面板指示点 |
indicator-color | color | rgba(0, 0, 0, .3) | 指示点颜色 |
indicator-active-color | color | #000000 | 当前选中的指示点颜色 |
autoplay | boolean | false | 是否自动切换 |
interval | number | 5000 | 自动切换时间间隔 |
circular | boolean | false | 是否采用衔接滑动 |
4.text 文本组件
类似于 HTML 中的 span 标签,是一个行内元素
通过 text 组件的 selectable 属性,实现长按选中文本内容的效果
5.rich-text 富文本组件
支持把 HTML 字符串渲染为 WXML 结构
通过 rich-text 组件的 nodes 属性节点,把 HTML 字符串渲染为对应的 UI 结构
6.button
按钮组件
功能比html中的button按钮丰富
通过open-type属性可以调用微信提供的各种功能(客服,转发,获取用户授权,获取用户信息等)
7.image
图片组件
image组件默认宽度约300px,高度约200px
image的mode属性用来指定图片的裁剪和缩放模式,常用的mode属性值如下
mode 值 | 说明 |
scaleToFill | (默认值)缩放模式,不保持纵横比缩放图片,使图片的宽高完全拉伸至填满 image 元素 |
aspectFit | 缩放模式,保持纵横比缩放图片,使图片的长边能完全显示出来。也就是说, 可以完整地将图片显示出来。 |
aspectFill | 缩放模式,保持纵横比缩放图片,只保证图片的短边能完全显示出来。也就是说, 图片通常只在水平或垂直方向是完整的,另一个方向将会发生截取。 |
widthFix | 缩放模式,宽度不变,高度自动变化,保持原图宽高比不变 |
heightFix | 缩放模式,高度不变,宽度自动变化,保持原图宽高比不变 |
8.navigator
页面导航组件
类似于html中的a标签
边栏推荐
- Debezium series: modify the source code to support UNIX_ timestamp() as DEFAULT value
- CTF逆向基础
- 1:引文;
- Wechat applet regular expression extraction link
- Flume series: interceptor filtering data
- ffplay文档[通俗易懂]
- 14. Users, groups, and permissions (14)
- 计算lnx的一种方式
- Hong Kong stocks will welcome the "best ten yuan store". Can famous creative products break through through the IPO?
- Is it safe for Galaxy Securities to open an account online?
猜你喜欢

leetcode刷题:二叉树10(完全二叉树的节点个数)
![Scala basics [HelloWorld code parsing, variables and identifiers]](/img/75/1d89581b9b8299ffb55d95514e6df4.png)
Scala basics [HelloWorld code parsing, variables and identifiers]

Leetcode skimming: binary tree 10 (number of nodes of a complete binary tree)

.Net分布式事務及落地解决方案

After 95, Alibaba P7 published the payroll: it's really fragrant to make up this

Leetcode brush questions: binary tree 18 (largest binary tree)

How to select the Block Editor? Impression notes verse, notation, flowus

Jvmrandom cannot set seeds | problem tracing | source code tracing

Go language | 03 array, pointer, slice usage

Wechat applet regular expression extraction link
随机推荐
PyTorch 1.12发布,正式支持苹果M1芯片GPU加速,修复众多Bug
sort和投影
2023年深圳市绿色低碳产业扶持计划申报指南
E. Singhal and Numbers(质因数分解)
leetcode刷题:二叉树15(找树左下角的值)
.Net分布式事務及落地解决方案
A solution to PHP's inability to convert strings into JSON
【数字IC验证快速入门】3、数字IC设计全流程介绍
【数字IC验证快速入门】9、Verilog RTL设计必会的有限状态机(FSM)
nprogress插件 进度条
Elk distributed log analysis system deployment (Huawei cloud)
Flume series: interceptor filtering data
ROS2专题【01】:win10上安装ROS2
C langue OJ obtenir PE, ACM démarrer OJ
Debezium series: idea integrates lexical and grammatical analysis ANTLR, and check the DDL, DML and other statements supported by debezium
解决php无法将string转换为json的办法
Wechat applet regular expression extraction link
About the priority of Bram IP reset
y57.第三章 Kubernetes从入门到精通 -- 业务镜像版本升级及回滚(三十)
Is it safe for CICC fortune to open an account online?