设置面板的状态。
Syntax
Microsoft.CIFramework.setMode(value).then(successCallback, errorCallback);
参数
| Name | 类型 | 必选 | Description | ||||
|---|---|---|---|---|---|---|---|
| value | 编号 | 是的 | 用于设置面板模式的值。
|
||||
| success回调 | 功能 | 否 | 设置面板状态的请求成功时调用的函数。 | ||||
| errorCallback | 功能 | 否 | 设置面板状态的请求失败时调用的函数。 |
返回值
返回一个带有值的 Promise 对象。
Example
// Setting Panel to minimize mode.
Microsoft.CIFramework.setMode(0).then(
function (result) {
// result will have current state of the panel.
console.log(result)
},
function (error) {
// code handling for promise failure
console.log(error)
});