8

微信小程序(6):基础内容组件

 3 years ago
source link: https://blog.csdn.net/qq_43652492/article/details/111866010
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

一、icon 图标

在这里插入图片描述

<icon type="success" size="40"/>
<icon type="success_no_circle" size="40"/>
<icon type="info" size="40"/>
<icon type="warn" size="40"/>
<icon type="waiting" size="40"/>
<icon type="cancel" size="40"/>
<icon type="download" size="40"/>
<icon type="search" size="40"/>
<icon type="clear" size="40"/>

在这里插入图片描述
当然,也可以用 color 指定 icon 的颜色:

<icon type="success" size="40" color="pink"/>

在这里插入图片描述

二、progress 进度条

progress 的属性有很多,比如以下几个:

1、percent:百分比0~100
<progress percent="40"/>

在这里插入图片描述

2、show-info:在进度条右侧显示百分比
<progress percent="40" show-info />

在这里插入图片描述

3、border-radius:圆角大小
<progress percent="40" show-info  border-radius="5"/>

在这里插入图片描述

4、font-size:右侧百分比字体大小
<progress percent="40" show-info  border-radius="5" font-size="18"/>

在这里插入图片描述

5、stroke-width:进度条线的宽度(指的是粗细)
<progress percent="40" show-info  border-radius="5" font-size="18" stroke-width="10"/>

在这里插入图片描述

6、activeColor:已选择的进度条的颜色
<progress percent="40" show-info activeColor="blue"/>

在这里插入图片描述

7、backgroundColor:未选择的进度条的颜色
<progress percent="40" show-info activeColor="blue" backgroundColor="red"/>

在这里插入图片描述

8、active:进度条从左往右的动画
<progress percent="40" show-info activeColor="blue" backgroundColor="red" active/>

可以看到进度是慢慢增长到40%的。
在这里插入图片描述

9、active-mode:backwards: 动画从头播;forwards:动画从上次结束点接着播
10、duration:进度增加1%所需毫秒数,默认是30
<progress percent="40" show-info activeColor="blue" backgroundColor="red" active duration="60"/>

这里我们设置成60,可以看到进度增长的明显慢了。
在这里插入图片描述

三、rich-text 富文本

<rich-text nodes='<div style="color:blue"><b>小程序</b>开发</div>'></rich-text>

在这里插入图片描述


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK