openMiniWidget
Requires:
BaseKit≥3.0.3@ray-js/ray≥0.8.0
Platforms:
iOSAndroid
Method signature
openMiniWidget(params: )Minimum SDK versions
- iOS
ThingSmartBaseKitBizBundle - ≥ 5.2.1
- Android
com.thingclips.smart:thingsmart-bizbundle-basekit - ≥ 5.2.0
Description
Open the widget popup
Parameters
| Property | Type | Required | Default | Description | BaseKit Since | Minimum SDK versions |
|---|---|---|---|---|---|---|
appId | string | Yes | - | AppID of the widget to open | - | — |
pagePath | string | No | - | Relative URL of the widget page; if empty, opens the home page. The part after ? in path becomes the query | - | — |
deviceId | string | No | - | Panel-type device ID | - | — |
groupId | string | No | - | Panel-group type group ID | - | — |
style | string | No | "middle" | Widget style, default: middle | - | — |
versionType | "release" | "preview" | No | 'release' | Version type, default: release | - | — |
version | string | No | - | Version | - | — |
position | "bottom" | "top" | "center" | No | 'bottom' | Display position, default: bottom | - | — |
autoDismiss | boolean | No | true | Whether clicking outside closes the popup | v3.0.4 | — |
autoCache | boolean | No | true | Whether to prioritize showing the default cache. This property takes effect in Miniapp container 3.1.0 | v3.1.0 | — |
supportDark | boolean | No | true | Whether dark mode is supported | v3.1.3 | — |
complete | () => void | No | - | Completion callback (executed on both success and failure) | - | — |
success | () => void | No | - | Callback on successful API call | - | — |
fail | (params: Object) => void | No | - | Failure callback | - | — |
fail callback parameters
| Property | Type | Description |
|---|---|---|
errorMsg | string | Error message |
errorCode | string | number | Error code |
| Error extension |
Return Value
Type: MiniWidgetDialog
MiniWidgetDialog
| Property | Type | Description | BaseKit Since | Minimum SDK versions |
|---|---|---|---|---|
dismissMiniWidget | function | Close the widget popup | - | — |
onWidgetDismiss | function | Listen for the widget close event | v3.0.4 | — |
offWidgetDismiss | function | Stop listening to the widget close event | v3.0.4 | — |
Valid Values
versionType
| Value | Description | BaseKit Since |
|---|---|---|
release | Production version | - |
preview | Pre-release version | - |
position
| Value | Description | BaseKit Since |
|---|---|---|
bottom | Display at the bottom | - |
top | Display at the top | - |
center | Display in the center | v3.4.0 |