欧美日韩国产一区,亚洲一区视频,色综合久久久久,私密按摩师舌头伸进去了,99re6这里只有精品,夜夜性日日交xxx性hd

toast顯示消息提示

本文編輯: DevelopeWhite DevelopeWhite瀏覽 6101 版權(quán)所有,嚴禁轉(zhuǎn)載

組件說明:

Toast是當用戶點擊某些組件時彈出來來的提示消息。Toast會幫助你創(chuàng)建和顯示這些消息。Toast是一種簡易的消息提示框。當視圖顯示給用戶,在應(yīng)用程序中顯示為浮動。小程序即將廢棄Toast組件,故這里介紹Toast的API:wx.showToast

組件用法:


wxml

<!--index.wxml-->
<view class="content">
  <text class="showfunc">Toast功能</text>
  <view class="con-button">
    <button class="button-left" bindtap="showToast">展示Toast</button>
    <button class="button-right" bindtap="hideToast">隱藏Toast</button>
  </view>
</view>

js

Page({
  showToast:function(){
    var that=this;
    wx.showToast({
      title: '成功',
      icon: 'success',
      duration: 2000,
      success: that.flySuccess,
      fail:that.flyFail,
      complete:that.flyComplete
    })
  },

  hideToast:function(){
    var that=this;
    wx.showToast({
      title: '加載中',
      icon: 'loading',
      duration: 10000,
      success: that.loadingSuccess,
      fail:that.loadingFail,
      complete:that.loadingComplete
    });

    setTimeout(function(){
      wx.hideToast()
    },2000)
  },

  flySuccess:function(e){
    console.log(e);
    console.log("起飛成功!");
  },
  flyFail:function(e){
    console.log(e);
    console.log("起飛失敗!")
  },
  flyComplete:function(e){
    console.log(e);
    console.log("起飛結(jié)束!")
  },
  loadingSuccess:function(e){
    console.log(e);
    console.log("加載成功!");
  },
  loadingFail:function(e){
    console.log(e);
    console.log("加載失敗!")
  },
  loadingComplete:function(e){
    console.log(e);
    console.log("加載結(jié)束!")
  }
})

wxss

/**index.wxss**/
.con-button{
  display: flex;
  flex-direction: row;
  padding-top: 10%;
}

.showfunc{
  padding-top:10%;
  display: block;
  text-align: center;
  color: green;
}

主要參數(shù):

參數(shù) 類型 是否必填 參數(shù)描述
title String 該提示框提示的內(nèi)容
icon String 該提示框的圖標,只支持”success”、”loading”
duration Number 提示的延遲時間,單位毫秒,默認:1500, 最大為10000
success Function 該接口調(diào)用成功的回調(diào)函數(shù)
fail Function 接口調(diào)用失敗的回調(diào)函數(shù)
complete Function 接口調(diào)用結(jié)束的回調(diào)函數(shù)(調(diào)用成功、失敗都會執(zhí)行)
如有技術(shù)問題或?qū)Ρ疚挠蟹答仯埣尤隥Q群:
微信小程序?qū)崙?zhàn)5營: 微信小程序Club實戰(zhàn)5營