my.navigateBack

Close the current page and return to the previous one or more pages. It is possible to use getCurrentPages to get the current page stack information and decide how many levels to return.

Sample Code

copy
// Note: When calling navigateTo API, the page that called the method will be added to the stack.

// This is the page one
my.navigateTo({
  url: 'two?pageId=10000'
})

// This is the page two
my.navigateTo({
  url: 'one?pageId=99999'
})

// navigateBack in page three , will return page one
my.navigateBack({
  delta: 2
})

Parameters

PropertyTypeDefaultDescription
deltaNumber1Number of pages to return. If delta is greater than the number of open pages, it returns to the home page.