提交 16227359 编写于 作者: H HuangXW

modify baseContext

Change-Id: I511f26472248a1cf5abd5e7d8e9f63e108cd28cf
Signed-off-by: NHuangXW <huangxinwei4@huawei.com>
上级 44b60327
# BaseContext
BaseContext抽象类用于表示继承的子类Context是Stage模型还是FA模型。
BaseContext抽象类用于表示继承的子类Context是Stage模型还是FA模型,是所有Context类型的父类
> **说明:**
>
......@@ -14,10 +14,15 @@ BaseContext抽象类用于表示继承的子类Context是Stage模型还是FA模
**示例:**
```ts
class MyContext extends BaseContext {
constructor(stageMode) {
this.stageMode = stageMode;
}
以Stage模型为例,用户可通过UIAbilityContext访问stageMode字段。
```ts
import UIAbility from '@ohos.app.ability.UIAbility';
class MainAbility extends UIAbility {
onCreate(want, launchParam) {
// MainAbility onCreate, isStageMode: true
console.log("MainAbility onCreate, isStageMode: " + this.context.stageMode);
}
```
\ No newline at end of file
}
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册