Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

WeChat program API closes all pages


May 19, 2021 WeChat Mini Program Development Document


Table of contents


wx.reLaunch(Object object)

Base library 1.1.0 starts to support, and low versions need to be compatible.

Close all pages and open a page within the app

Parameters

Object object

Property Type The default Required Description
Url string Is The in-app page path (code pack path) that needs to be jumped can be followed by parameters. U sed between parameters and paths? Separation, parameter keys are connected to parameter values, different parameters are separated by , such as 'path?key=value=value=key2=value2'
success function Whether The interface calls a successful callback function
fail function Whether The interface calls the failed callback function
complete function Whether Callback function at end of interface call (call succeeds, fails are executed)

The sample code

wx.reLaunch({
  url: 'test?id=1'
})
// test
Page({
  onLoad (option) {
    console.log(option.query)
  }
})