<view ><text>我是文本組件</text></view><text>{{text}}</text>
Page({/*** 初始化數(shù)據(jù)*/data:{text:"我是在js文件中綁定的文本"},onLoad:function(options){// 頁(yè)面初始化 options為頁(yè)面跳轉(zhuǎn)所帶來(lái)的參數(shù)},onReady:function(){// 頁(yè)面渲染完成},onShow:function(){// 頁(yè)面顯示},onHide:function(){// 頁(yè)面隱藏},onUnload:function(){// 頁(yè)面關(guān)閉}})
<progresspercent="80"show-info="true"stroke-width="5"color="red"active="true"/>
button按鈕用的算是最普遍的組件之一。
<!--按鈕默認(rèn)樣式,點(diǎn)擊事件--><button type="defaule" bindtap="clickButton">Defalut</button><!--原始顏色,不可點(diǎn)擊狀態(tài), 正在加載狀態(tài)--><button type="primary" disabled="true" loading="true">Primary</button><button type="warn">warn</button>
Page({data:{// text:"這是一個(gè)頁(yè)面"},/*** button點(diǎn)擊事件監(jiān)聽(tīng)*/clickButton: function(e) {//打印所有關(guān)于點(diǎn)擊對(duì)象的信息console.log(e);},onLoad:function(options){// 頁(yè)面初始化 options為頁(yè)面跳轉(zhuǎn)所帶來(lái)的參數(shù)},onReady:function(){// 頁(yè)面渲染完成},onShow:function(){// 頁(yè)面顯示},onHide:function(){// 頁(yè)面隱藏},onUnload:function(){// 頁(yè)面關(guān)閉}})