未验证 提交 fbea9521 编写于 作者: L liminjie10 提交者: Gitee

update zh-cn/application-dev/reference/apis/js-apis-settings.md.

修改enableAirplaneMode(enable: boolean): Promise\<void>的示例代码
Signed-off-by: Nliminjie10 <liminjie10@huawei.com>
上级 d355bc5c
......@@ -422,13 +422,11 @@ enableAirplaneMode(enable: boolean): Promise\<void>
```js
let isEnabled = true;
settings.enableAirplaneMode(isEnabled).then((err) => {
if (err) {
console.log('Failed to enable AirplaneMode.');
return;
}
console.log('Return true if enable.');
});
settings.enableAirplaneMode(isEnabled).then(() => {
console.log('Succeeded in enabling AirplaneMode.');
}).catch((err) => {
console.log(`Failed to enable AirplaneMode. Cause: ${err}`);
})
```
## settings.canShowFloating
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册