色婷婷五月综合久久中文_亚洲性爱毛片免费看_21国产精品喷潮白浆_国产精品无码亚洲精品2022_久久久亚洲国产精品性色

Menu
小程序資訊
小程序資訊
微信小程序把玩《四》:text組件,progress組件,button組件
時(shí)間:2016-10-18 19:04:00
一:text組件

通常文本設(shè)置要不在wxml中設(shè)置,再要不就是通過(guò)weml綁定在js中設(shè)置文字。

wxml

<view >
    <text>我是文本組件</text>
</view>
<text>{{text}}</text>
js

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)閉
  }
})

二:progress組件

進(jìn)度條描述的是一種加載的狀態(tài),比如軟件升級(jí)下載進(jìn)度, 視頻,圖片下載進(jìn)度…

主要屬性:



wxml

<progress 
    percent="80"
    show-info="true" 
    stroke-width="5"
    color="red"
    active="true"/>

三:button組件

button按鈕用的算是最普遍的組件之一。

主要屬性:


wxml

<!--按鈕默認(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>
js

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)閉
  }
})
咨詢(xún)
微信掃碼咨詢(xún)
電話咨詢(xún)
400-888-9358