小程序開發-使用Loading和Toast提示框


小程序提示框

Loading提示框使用方式

1. 在wxml中作為組件使用
<loading hidden="{{hidden}}">
    加載中...
</loading>

通過設置hidden的值來控制Loading提示框的顯示和隱藏

2. 在js中調用對應方法
  • 顯示: wx.showLoading({title: "加載中…", duration: 2000})
  • 隱藏: wx.hideLoading()

Toast提示框的使用方式

mp-loading提示的使用

作為weui組件使用

  • app.json中配置
 "useExtendedLib": {
    "weui": true
  }
  • 在需要使用的頁面json中導入
"usingComponents": {
        "mp-loading": "/miniprogram_npm/weui-miniprogram/loading/loading"
    },

詳細可以參考: https://developers.weixin.qq.com/miniprogram/dev/extended/weui/loading.html


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM