这篇文章主要介绍了小程序组件怎么用,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。
icon
icon组件有3个属性,如下:
type,可选值:success, success_no_circle, info, info_circle,warn, waiting, cancel, download, search, clear
color,如#C9C9C9。
size,默认为23px。
再看具体的wxml和wxss。
<code class="language-wxml hljs fsharp has-numbering"><view class="demo-view-4"><view class="view-1"><icon class="margin" type="circle"><view class="margin">circle:多选未选中</view></icon></view><view class="view-1"><icon class="margin" type="success"><view class="margin">success:成功或已选中</view></icon></view><view class="view-1"><icon class="margin" type="success_no_circle"><view class="margin">success_no_circle:单选已选中</view></icon></view><view class="view-1"><icon class="margin" type="info"><view class="margin">info:信息提示</view></icon></view><view class="view-1"><icon class="margin" color="#C9C9C9" type="warn"><view class="margin">warn-#C9C9C9:普通警告</view></icon></view><view class="view-1"><icon class="margin" type="warn"><view class="margin">warn:强烈警告</view></icon></view><view class="view-1"><icon class="margin" type="waiting"><view class="margin">waiting:等待</view></icon></view><view class="view-1"><icon class="margin" type="download"><view class="margin">download:可下载</view></icon></view><view class="view-1"><icon class="margin" type="info_circle"><view class="margin">info_circle:有信息提示</view></icon></view><view class="view-1"><icon class="margin" type="cancel"><view class="margin">cancel:停止或关闭</view></icon></view><view class="view-1"><icon class="margin" type="search"><view class="margin">search:搜索</view></icon></view><view class="view-1"><icon class="margin" type="clear"><view class="margin">clear:删除</view></icon></view><view class="view-1"><view class="margin">PS:每个type都可以设置颜色(color),大小(size)</view></view></view></code></pre><pre class="prettyprint" name="code"><code class="language-css hljs has-numbering">.demo-view-4{ display:flex; height: 100%; flex-direction: column;}.view-1{ display:flex; height: 100%; flex-direction: row;}.margin{ margin: 20rpx;}</code>
text
wxml如下:
<code class="language-xml hljs has-numbering"><text>My name is wisely。\n I am a Androider!</text></code>
progress
progress组件的属性如下:
属性名 | 类型 | 默认值 | 说明 |
---|---|---|---|
percent | Float | 无 | 百分比0~100 |
show-info | Boolean | false | 在进度条右侧显示百分比 |
stroke-width | Number | 6 | 进度条线的宽度,单位px |
color | Color | #09BB07 | 进度条颜色 (请使用 activeColor) |
activeColor | Color | 已选择的进度条的颜色 | |
backgroundColor | Color | 未选择的进度条的颜色 | |
active | Boolean | false | 进度条从左往右的动画 |
感谢你能够认真阅读完这篇文章,希望小编分享的“小程序组件怎么用”这篇文章对大家有帮助,同时也希望大家多多支持编程网,关注编程网行业资讯频道,更多相关知识等着你来学习!