loading.js 450 B

1234567891011121314151617181920212223242526
  1. // pages/element/loading/loading.js
  2. Page({
  3. data: {
  4. loading: true
  5. },
  6. showLoading: function () {
  7. var that = this;
  8. this.setData({
  9. showLoading: true
  10. })
  11. setTimeout(function () {
  12. that.setData({
  13. showLoading: false
  14. })
  15. }, 2000)
  16. },
  17. // onLoad: function () {
  18. // var that = this;
  19. // setTimeout(function () {
  20. // that.setData({
  21. // loading: true
  22. // })
  23. // }, 3000)
  24. // }
  25. })