微信小程序开发之组件使用教程。
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 | 进度条从左往右的动画 |
效果图如下:
新闻热点
疑难解答