How does Mini Program get the page object of the current page

The instance of

app is getApp ()

how can I get the current instance of page?

var page = Page ({})

is this all right? Or is it in some other way


get it directly with this in the function defined in the page object;

or:

var pages = getCurrentPages()    //
var currentPage = pages[pages.length-1]    //

you can test it with the following code:

Page({
    onLoad:function(){
        var pages = getCurrentPages()    //
        var currentPage = pages[pages.length - 1]    //
        console.log("page:")
        console.log(currentPage===this)    //true
    }
})
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e51c12-45160.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e51c12-45160.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?