Small micro-channel program determines whether to return the page from the other pages

Variable in a custom tag data, the onLoad in

Page ({ 
  Data: { 
    isNewOpen: to true , // determines whether the current page is a new or return from the open other pages   
    List: [], 
    Page: 0 
  }, 

  the onLoad: function () { 
     the this .getList () 
  }, 
 
  the getList () { 
      // ... 
  }, 
  
  goDetail (E) { 
    the this .setData ({ 
      isNewOpen: to false 
    }) 
    wx.navigateTo ({ 
      URL: ` / Pages / Detail / detail`,
     }) 
  }, 
 
  onShow: function () { IF ( ! the this .data.isNewOpen) {
      this.setData({
        page: 2, // 页码
        isClose: true,
        list: []
      })
      this.getList()
    }
  },
})

 

Guess you like

Origin www.cnblogs.com/djjlovedjj/p/11124425.html