### icon標簽
圖標。

示例:
wxml:
<view class="group">
<block wx:for="{{iconSize}}">
<icon type="success" size="{{item}}"/>
</block>
</view>
<view class="group">
<block wx:for="{{iconType}}">
<icon type="{{item}}" size="40"/>
</block>
</view>
<view class="group">
<block wx:for="{{iconColor}}">
<icon type="success" size="40" color="{{item}}"/>
</block>
</view>
js:
Page({
data: {
iconSize: [20, 30, 40, 50, 60, 70],
iconColor: [
'red', 'orange', 'yellow', 'green', 'rgb(0,255,255)', 'blue', 'purple'
],
iconType: [
'success', 'success_no_circle', 'info', 'warn', 'waiting', 'cancel', 'download', 'search', 'clear'
]
}
})

### text標簽
文本。

Tips
decode可以解析的有 < > & '    
各個操作系統的空格標準并不一致。
<text/> 組件內只支持 <text/> 嵌套。
除了文本節點以外的其他節點都無法長按選中。
示例:
wxml:
<view class="btn-area">
<view class="body-view">
<text>{{text}}</text>
<button bindtap="add">add line</button>
<button bindtap="remove">remove line</button>
</view>
</view>
js:
var initData = 'this is first line\nthis is second line'
var extraLine = [];
Page({
data: {
text: initData
},
add: function(e) {
extraLine.push('other line')
this.setData({
text: initData + '\n' + extraLine.join('\n')
})
},
remove: function(e) {
if (extraLine.length > 0) {
extraLine.pop()
this.setData({
text: initData + '\n' + extraLine.join('\n')
})
}
}
})

### rich-text標簽
基礎庫 1.4.0 開始支持,低版本需做兼容處理
富文本。

支持默認事件,包括:tap、touchstart、touchmove、touchcancel、touchend和longtap
nodes 屬性推薦使用 Array 類型,由于組件會將 String 類型轉換為 Array 類型,因而性能會有所下降
nodes
現支持兩種節點,通過type來區分,分別是元素節點和文本節點,默認是元素節點,在富文本區域里顯示的HTML節點
元素節點:type = node

文本節點:type = text

示例:
wxml:
<!-- rich-text.wxml -->
<rich-text nodes="{{nodes}}" bindtap="tap"></rich-text>
js:
// rich-text.js
Page({
data: {
nodes: [{
name: 'div',
attrs: {
class: 'div_class',
style: 'line-height: 60px; color: red;'
},
children: [{
type: 'text',
text: 'Hello World!'
}]
}]
},
tap() {
console.log('tap')
}
})
Bug & Tip
tip: nodes 不推薦使用 String 類型,性能會有所下降。
tip: rich-text 組件內屏蔽所有節點的事件。
tip: attrs 屬性不支持 id ,支持 class 。
tip: name 屬性大小寫不敏感。
tip: 如果使用了不受信任的HTML節點,該節點及其所有子節點將會被移除。
tip: img 標簽僅支持網絡圖片。
tip: 如果在自定義組件中使用 rich-text 組件,那么僅自定義組件的 wxss 樣式對 rich-text 中的 class 生效。
### progress標簽
進度條。

示例:
<progress percent="20" show-info />
<progress percent="40" stroke-width="12" />
<progress percent="60" color="pink" />
<progress percent="80" active />

- 商城api接口
- 首頁數據獲取
- 分類接口
- 購物車接口
- 商品信息接口
- 搜索接口
- 訂單列表接口
- 店鋪接口
- 收藏接口
- 收貨地址接口
- 生成訂單接口
- 支付接口
- 會員中心接口
- 登錄注冊接口
- 關于我們
- 圖片上傳
- 分銷中心
- 分銷明細
- 代金券
- 平臺紅包列表
- 分銷申請列表
- 我的推廣
- 微信小程序
- 簡介
- 開發前準備
- 目錄結構介紹
- 發起請求
- 網絡請求提交表單
- 代碼及開發所遇到問題總結
- 導航跳轉時所遇到的問題
- 緩存數據與數據取得的問題
- 如何引入外部css
- 如何定義與使用全局變量
- 如何定義新的界面
- 微信小程序支付
- 小程序的手機驗證碼登錄
- 上傳,下載
- 提示框
- app.json配置
- 配置demo
- pages
- window
- tabBar
- networkTimeout
- debug
- page.json
- 緩存
- 特效
- 滑動方式
- 城市切換
- 五星好評
- Switch
- 上拉加載
- wxml 標簽
- 視圖容器
- 基礎內容
- 表單組件
- 導航
- 媒體組件
- 自定義提示框
- 小程序內訪問網頁
- 倒計時顯示
- 微信小程序,如何在返回前一個頁面時,執行前一個頁面的方法
- 在本地可以請求到數據,但手機上是請求不到的
- curl請求失敗
- 代碼同步
- 短信平臺更換