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

一、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>

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值