web前端全系列 教程
1839个小节阅读:2244.3k
目录
鸿蒙应用开发
C语言快速入门
JAVA全系列 教程
面向对象的程序设计语言
Python全系列 教程
Python3.x版本,未来主流的版本
人工智能 教程
顺势而为,AI创新未来
大厂算法 教程
算法,程序员自我提升必经之路
C++ 教程
一门通用计算机编程语言
微服务 教程
目前业界流行的框架组合
web前端全系列 教程
通向WEB技术世界的钥匙
大数据全系列 教程
站在云端操控万千数据
AIGC全能工具班
A A
White Night
组件是视图层的基本组成单元
视图容器
它类似于传统html中的div,用于包裹各种元素内容
<view class="container">
<view class="box1"></view>
<view class="box2"></view>
<view class="box3"></view>
</view>
xxxxxxxxxx
.container{
height: 100px;
display: flex;
}
.container view{
flex:1;
height: 100px;
}
.container .box1{
background-color: red;
}
.container .box2{
background-color: green;
}
.container .box3{
background-color: blue;
}
文本组件
用于包裹文本内容
xxxxxxxxxx
<view class="box1">
<text>盒子1</text>
</view>
xxxxxxxxxx
.container view{
flex:1;
height: 100px;
text-align: center;
}
Tip
<text>
组件内只支持嵌套<text>
,不支持其它组件或自定义组件,否则会引发在不同平台的渲染差异如果使用
<span>
组件编译时会被转换为<text>
除了文本节点以外的其他节点都无法长按选中
图标
xxxxxxxxxx
<view>
<icon color="green" type="success" size="26"/>
</view>
属性说明
属性名 | 类型 | 默认值 | 说明 |
---|---|---|---|
type | String | icon的类型 | |
size | Number | 23 | icon的大小,单位px |
color | Color | icon的颜色,同css的color |
type 有效值
xxxxxxxxxx
success, success_no_circle, info, warn, waiting, cancel, download, search, clear
Tip
由于 icon 组件各端表现存在差异,可以通过使用 字体图标 的方式来弥补各端差异
实时效果反馈
1. uni-app中,下列那个组件适合承载文本信息:
A view
B text
C span
D icon
答案
1=>B