Applet page in the life cycle (for information only)

Maintaining sleep and not wake up every day in a state
that only a man numb numb
numb breathing forget their existence

 

Page (page) in the life cycle and the method functions: 
    page js file in the page is the page of configuration items is not a global life cycle written in the page where 
    
    // index.js
     // obtain application examples 
    const App = getApp ()
     // global attributes defined using
     // the console.log (app.globalData.n) 
    
    // CI page, the life cycle of both parameters 
    page ({ 
      Data: { 
        // Data used to define the state of the page
         / / rendering of the current page by directly writing the attribute {{}} 
        m: " Zhang line " , 
        S: " to Suzhou " 
      }, 
    
      the onLoad () { 
        // monitor page load is to initialize 
        the console.log ( " the load ") 
      }, 
    
      OnShow () { 
        // listen for page display foreground background switch will execute the lifecycle 
        console.log ( " Show " ) 
      }, 
    
      the onReady () { 
        // listen for the first time the page rendering is complete 
        console.log ( " Ready " ) 
      }, 
    
      onHide () { 
        // monitor page is hidden when switching pages will perform 
        console.log ( " Hide " ) 
      }, 
    
      onUnload () { 
        // listening page unload 
        console.log ( " unload " ) 
      }, 
    
      onPullDownRefresh ( ) { 
        //This function will execute when the user listens pull-down action pull-down refresh
         // That down data update operation where 
        the console.log ( " pull-down performed " ) 
      }, 
    
      onReachBottom () { 
        // page upload more LAC will execute the function
         / / in this function pull operation on 
        console.log ( " the LAC upload more " ) 
      }, 
    
      onShareAppMessage () { 
        // the user clicks on the top right corner forward is to share (...) will perform this function
         // With click on this function. . . Will be forwarded without this function would not have forwarded 
        return { 
          title: ' a good time today ' , 
          path: ' Pages and the / index / index ' 
        } 
      },
     
      OnPageScroll () { 
        // page scroll trigger 
        console.log ( " the page is scrolled " ) 
      }, 
    
      onTabItemTap (... REST) { 
        // current tab page is triggered when you click tab 
        console.log (REST);
         // switch pages in return trigger recording user clicks the button
         //   text: represents the tabbar name to switch pages
         //   pagePath: represents the path which returns back to the page 
      } 
    }) 
    
    
    / * 
      life cycle will perform the first performance: 
        onLoad () {page load monitor initialization is 
          done ajax request data 
    
        } -> onShow () {page display foreground to background monitor switch will be executed lifecycle 
          data transmission parameters, one page to another page value may then pass the received onShow 
    
        } - -> onReady () {monitor the initial page rendering is complete
          Page is loaded, the time for data operation may be performed in the inside 
        }
    
    
      onShareAppMessage () {} forwarding function: 
        must return an object, the object has two path configuration title and 
        title: Title 
        path: transmission path (where to send) 
    
    * /

 

Guess you like

Origin www.cnblogs.com/home-/p/11593505.html