dlt.showTabBarRedDot
Introduction
Display a red dot in the top right corner of a specific item in the tabBar.
Usage Limitations
Supported in the basic library version 4.0.0
or higher.
Parameters
Object object
Property | Type | Default | Required | Description |
---|---|---|---|---|
index | number | Yes | The index of the tabBar item, starting from the left, with an initial value of 0. | |
success | function | No | Callback function for a successful API call. | |
fail | function | No | Callback function for a failed API call. | |
complete | function | No | Callback function for the completion of the API call (executed whether the call is successful or not). |
object.success Callback Function
Parameters
Object res
Property | Type | Description |
---|---|---|
success | string | true - Setting successful. |
object.fail Callback Function
Parameters
Object res
Property | Type | Description |
---|---|---|
success | string | false - Setting failed. |
Sample Code
// pages/index/index.js
Page({
showTabBarRedDot() {
dlt.showTabBarRedDot({
index: 0,
success: () => {
console.log('success');
},
});
},
});