May 19, 2021 WeChat Mini Program Development Document
Base library 1.4.3 starts to support, and low versions need to be compatible
Set the top bar text content, only the current small program is set to the top can take effect, if the current small program is not set to the top, can also be called successfully, but will not take effect immediately, only after the user put the small program top to replace the set text content. Note: After the call is successful, the interface needs to be called again at intervals of 5s, and if the interface is called again within 5s, it will call back to fail, err Msg: "setTopBarText: fail invoke too frequently"
OBJECT parameter description:
Parameters | Type | Required | Description |
---|---|---|---|
text | String | Is | Top bar text content |
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) |
Example code:
wx.setTopBarText({
text: 'hello, world!'
})