Other
Floating Button
The configuration for the floating button is done through the useWidgetBtn
attribute on the chat-component
component, which includes two mandatory parameters. The specific configuration is as follows:
pos
: 'leftTop' | 'rightTop' | 'leftBottom' | 'rightBottom'; Used to control the relative position of the floating button with respect to the widget. Options include: top-left corner, top-right corner, bottom-left corner, bottom-right corner.left
: '100px';top
: '40px'; Default position of the floating button on the screen.Parameters are separated by ';', as shown in the example below:
Add event listeners to the widget
The widget supports event listeners, and when the corresponding events are triggered, the widget will proactively execute the callback functions associated with the listened events. Currently, there are three supported events:
login
: Triggered when the user logs in. Callback function does not take any parameters.logout
: Triggered when the user logs out. Callback function does not take any parameters.unReadCount
: Triggered when the number of unread messages changes. Callback function takes the parameternum
, which represents the number of unread messages.
window.chatWidgetApi.on
Add event listeners to the widget
type: The type of events above, i.e., "login", "logout", etc. callback: Callback function
N/A
Last updated