Last updated October 22, 2026
Events
Register and remove listeners for lifecycle events such as launch, show, hide, destroy, and share.
Supported event names:
minis.launchminis.hideminis.showminis.destroyminis.share
TTMinis.on(eventName, callback)
Registers an event listener.
Returns
Field | Type | Description |
callbackId |
| The listener ID, used to remove the listener via |
Callback parameters
Field | Type | Description |
|
| The event payload. |
|
| Returned when an event error occurs. |
Example
const callbackId = TTMinis.on('minis.share', function (res) {
console.log('share event:', res.data);
});TTMinis.off(eventName, callbackId)
Removes an event listener.
Returns
Field | Type | Description |
result |
| Whether the listener was successfully removed. |
Example
const callbackId = TTMinis.on('minis.show', function (res) {
console.log('page show', res.data);
});
TTMinis.off('minis.show', callbackId);