qcloud-iotexplorer-h5-panel-sdk
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "qcloud-iotexplorer-h5-panel-sdk", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/release/qcloud-iotexplorer-h5-panel-sdk", |
@@ -48,2 +48,61 @@ # qcloud-iotexplorer-h5-panel-sdk | ||
### sdk.tips | ||
tips模块,样式和风格与连连小程序一致 | ||
#### sdk.tips.show: (message, options) => Promise | ||
* options.type?: 'info' | 'danger' | 'loading' | 'success'; | ||
* options.waitForHide?: boolean; 若为true,则 show 方法返回一个Promise,并且当关闭后才会触发 resolve | ||
* options.duration?: number; 展示提示的时间,单位毫秒,默认 1500 | ||
* options.delayDuration?: number; 默认0,单位毫秒,提示会在该延时后展示 | ||
* options.canClickClose?: boolean; 默认true,点击mask是否能够关闭提示 | ||
* options.canBeReplace?: boolean; 默认false,为false时上一个提示未关闭前,再次调用 tips.show会被忽略 | ||
展示tips | ||
#### sdk.tips.hide: () => Promise | ||
关闭tips | ||
#### sdk.tips.showLoading: (message, options) => Promise | ||
封装后的 tips.show 方法,等价于: | ||
``` | ||
this.show(message, { | ||
type: 'loading', | ||
canBeReplace: true, | ||
duration: 0, | ||
delayDuration: 200, | ||
canClickClose: false, | ||
...options, | ||
}) | ||
``` | ||
#### sdk.tips.hideLoading: () => Promise | ||
关闭loading tips | ||
> 注意,showLoading后必须主动调用hideLoading,否则tips永远不会消失 | ||
#### sdk.tips.showSuccess: (message, options) => Promise | ||
封装后的 tips.show 方法,等价于: | ||
``` | ||
this.show(message, { type: 'success', ...opts }); | ||
``` | ||
#### sdk.tips.showInfo: (message, options) => Promise | ||
封装后的 tips.show 方法,等价于: | ||
``` | ||
this.show(message, { type: 'info', ...options }); | ||
``` | ||
#### sdk.tips.showError: (error, options) => Promise | ||
* error: any; 可以为一个原生Error对象,可以为标准的api响应 { code, msg },也可以为一个字符串。 | ||
会先标准化处理错误展示信息后展示tips,等价于: | ||
``` | ||
return this.show(errMsg, { type: 'danger', mask, duration, ...options }); | ||
``` | ||
### sdk.onWsClose: (callback) => void; | ||
@@ -50,0 +109,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
279318
270
308
0