提交 7b539a84 编写于 作者: E ester.zhou

Update docs (13383)

Signed-off-by: Nester.zhou <ester.zhou@huawei.com>
上级 f7c5bc33
......@@ -16,15 +16,15 @@ Reference: [Notification](../reference/apis/js-apis-notification.md#notification
Example:
```
```ts
import WantAgent from '@ohos.wantAgent';
async function publishNotification() {
let wantAgentInfo = {
wants: [
{
bundleName: "com.example.notification",
abilityName: "MainAbility",
bundleName: "com.example.myapplication",
abilityName: "EntryAbility",
}
],
operationType: WantAgent.OperationType.START_ABILITIES,
......
......@@ -165,9 +165,9 @@ Before the window content is loaded, enable listening for the **systemAvoidAreaC
Example:
```
// MainAbility.ts
import window from '@ohos.window';
```ts
import Window from '@ohos.window';
import UIAbility from '@ohos.app.ability.UIAbility';
/**
* Set the immersive window and obtain the height of the status bar and navigation bar.
......@@ -187,7 +187,7 @@ async function enterImmersion(mainWindow: window.Window) {
statusBarContentColor: "#FF0000"
})
}
export default class MainAbility extends Ability {
export default class EntryAbility extends UIAbility {
// do something
async onWindowStageCreate(windowStage: window.WindowStage) {
let mainWindow = await windowStage.getMainWindow()
......@@ -213,7 +213,7 @@ You can obtain the changes in the width and height of a component through **onAr
Example:
```
```ts
Column() {
Text(this.value)
.backgroundColor(Color.Green).margin(30).fontSize(20)
......@@ -235,7 +235,7 @@ Bind the **\<List>** component to a **Scoller** object and obtain the offset thr
Example:
```
```ts
Column() {
List({ space: 20, initialIndex: 0,scroller: this.scroller}) {
ForEach(this.arr, (item) => {
......@@ -259,7 +259,7 @@ Column() {
Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
```
```ts
// In versions earlier than 3.1.5.5, obtain the value through router.getParams().key.
private value: string = router.getParams().value;
// In 3.1.6.5 and later versions, obtain the value through router.getParams()['key'].
......@@ -299,7 +299,7 @@ Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
The color can be represented in two formats, for example, 0x7F000000 or '\#7F000000'. The first two digits indicate opacity, and the last six digits indicate RGB.
```
```ts
fontColor(0x7F000000)
fontColor( '#7F000000' )
```
......
# @ohos.enterprise.adminManager
# @ohos.enterprise.adminManager (Enterprise Device Management)
The **adminManager** module provides enterprise device management capabilities so that devices have the custom capabilities required in enterprise settings.
......@@ -48,7 +48,7 @@ For details about the following error codes, see [Enterprise Device Management E
```js
let wantTemp = {
bundleName: "com.example.myapplication",
abilityName: "com.example.myapplication.MainAbility",
abilityName: "EntryAbility",
};
let enterpriseInfo = {
name: "enterprise name",
......@@ -100,7 +100,7 @@ For details about the following error codes, see [Enterprise Device Management E
```js
let wantTemp = {
bundleName: "com.example.myapplication",
abilityName: "com.example.myapplication.MainAbility",
abilityName: "EntryAbility",
};
let enterpriseInfo = {
name: "enterprise name",
......@@ -157,7 +157,7 @@ For details about the following error codes, see [Enterprise Device Management E
```js
let wantTemp = {
bundleName: "com.example.myapplication",
abilityName: "com.example.myapplication.MainAbility",
abilityName: "EntryAbility",
};
let enterpriseInfo = {
name: "enterprise name",
......@@ -324,7 +324,7 @@ Disables a device super administrator application based on the specified bundle
For details about the following error codes, see [Enterprise Device Management Error Codes](../errorcodes/errorcode-enterpriseDeviceManager.md).
| ID| Error Message |
| ID| Error Message |
| ------- | ----------------------------------------------------------------- |
| 9200005 | failed to disable the administrator application of the device. |
......@@ -582,7 +582,7 @@ For details about the following error codes, see [Enterprise Device Management E
```js
let wantTemp = {
bundleName: "com.example.myapplication",
abilityName: "com.example.myapplication.MainAbility",
abilityName: "EntryAbility",
};
let enterpriseInfo = {
name: "enterprise name",
......@@ -635,7 +635,7 @@ For details about the following error codes, see [Enterprise Device Management E
```js
let wantTemp = {
bundleName: "com.example.myapplication",
abilityName: "com.example.myapplication.MainAbility",
abilityName: "EntryAbility",
};
let enterpriseInfo = {
name: "enterprise name",
......@@ -676,7 +676,7 @@ For details about the following error codes, see [Enterprise Device Management E
```js
let wantTemp = {
bundleName: "com.example.myapplication",
abilityName: "com.example.myapplication.MainAbility",
abilityName: "EntryAbility",
};
adminManager.getEnterpriseInfo(wantTemp, (error, result) => {
if (error != null) {
......@@ -723,7 +723,7 @@ For details about the following error codes, see [Enterprise Device Management E
```js
let wantTemp = {
bundleName: "com.example.myapplication",
abilityName: "com.example.myapplication.MainAbility",
abilityName: "EntryAbility",
};
adminManager.getEnterpriseInfo(wantTemp).then((result) => {
console.log(result.name);
......
# @ohos.enterprise.deviceInfo
# @ohos.enterprise.deviceInfo (Device Information Management)
The **deviceInfo** module provides APIs for enterprise device information management, including the API for obtaining device serial numbers. These APIs can only be called by device administrator applications.
......@@ -45,7 +45,7 @@ For details about the following error codes, see [Enterprise Device Management E
```js
let wantTemp = {
bundleName: "com.example.myapplication",
abilityName: "com.example.myapplication.MainAbility",
abilityName: "EntryAbility",
};
deviceInfo.getDeviceSerial(wantTemp, (error, result) => {
if (error != null) {
......@@ -94,7 +94,7 @@ For details about the following error codes, see [Enterprise Device Management E
```js
let wantTemp = {
bundleName: "com.example.myapplication",
abilityName: "com.example.myapplication.MainAbility",
abilityName: "EntryAbility",
};
deviceInfo.getDeviceSerial(wantTemp).then((result) => {
console.log(result);
......@@ -136,7 +136,7 @@ For details about the following error codes, see [Enterprise Device Management E
```js
let wantTemp = {
bundleName: "com.example.myapplication",
abilityName: "com.example.myapplication.MainAbility",
abilityName: "EntryAbility",
};
deviceInfo.getDisplayVersion(wantTemp, (error, result) => {
if (error != null) {
......@@ -185,7 +185,7 @@ For details about the following error codes, see [Enterprise Device Management E
```js
let wantTemp = {
bundleName: "com.example.myapplication",
abilityName: "com.example.myapplication.MainAbility",
abilityName: "EntryAbility",
};
deviceInfo.getDisplayVersion(wantTemp).then((result) => {
console.log(result);
......@@ -227,7 +227,7 @@ For details about the following error codes, see [Enterprise Device Management E
```js
let wantTemp = {
bundleName: "com.example.myapplication",
abilityName: "com.example.myapplication.MainAbility",
abilityName: "EntryAbility",
};
deviceInfo.getDeviceName(wantTemp, (error, result) => {
if (error != null) {
......@@ -276,7 +276,7 @@ For details about the following error codes, see [Enterprise Device Management E
```js
let wantTemp = {
bundleName: "com.example.myapplication",
abilityName: "com.example.myapplication.MainAbility",
abilityName: "EntryAbility",
};
deviceInfo.getDeviceName(wantTemp).then((result) => {
console.log(result);
......
......@@ -17,7 +17,7 @@ Before using the **AccessibilityExtensionContext** module, you must define a chi
```ts
import AccessibilityExtensionAbility from '@ohos.application.AccessibilityExtensionAbility'
let axContext;
class MainAbility extends AccessibilityExtensionAbility {
class EntryAbility extends AccessibilityExtensionAbility {
onConnect(): void {
console.log('AxExtensionAbility onConnect');
axContext = this.context;
......
# InputMethodExtensionContext
# @ohos.inputmethodextensioncontext (InputMethodExtensionContext)
The **InputMethodExtensionContext** module, inherited from **ExtensionContext**, provides context for **InputMethodExtension** abilities.
......@@ -20,7 +20,7 @@ Before using the **InputMethodExtensionContext** module, you must define a child
```js
import InputMethodExtensionAbility from '@ohos.inputmethodextensionability';
class MainAbility extends InputMethodExtensionAbility {
class EntryAbility extends InputMethodExtensionAbility {
onCreate() {
let context = this.context;
}
......
......@@ -173,7 +173,7 @@ The following examples are not intended as copy-paste-ready. Further customizati
"clickOneDay": {
"action": "router",
"bundleName": "com.example.calendar",
"abilityName": "com.example.calendar.MainAbility",
"abilityName": "EntryAbility",
"params": {
"action": "click_month_view_event",
"day": "$event.day",
......
......@@ -112,7 +112,7 @@ You can also implement redirection to the target application using a **want**, w
"action": "router",
"want": {
"bundleName": "com.example.myapplication",
"abilityName": "com.example.entry.MainAbility"
"abilityName": "EntryAbility"
}
},
"routerEventName2": {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册