以下为大家介绍小程序开发过程中,小程序组件的使用教程。小程序组件是小程序开发中非常重要的部分,是开发者必须掌握的技能。
icon组件有3个属性,如下:
再看具体的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>
wxml如下:
<code class="language-xml hljs has-numbering"><text>My name is wisely。\n I am a Androider!</text></code>
progress组件的属性如下:
属性名 | 类型 | 默认值 | 说明 |
---|---|---|---|
percent | Float | 无 | 百分比0~100 |
show-info | Boolean | false | 在进度条右侧显示百分比 |
stroke-width | Number | 6 | 进度条线的宽度,单位px |
|
|
|
|
activeColor | Color | 已选择的进度条的颜色 | |
backgroundColor | Color | 未选择的进度条的颜色 | |
active | Boolean | false | 进度条从左往右的动画 |
全国7x24小时客服热线
所有故障均24小时内解决
项目一次性收费安心
技术人员均从业5年以上
通过技术营销传播企业服务价值
丰富的行业实战经验积累
基于需求研发多款产品
针对需求提供精细化服务