// For the script URL "entry/ets/workers/worker.ts" in the stage model:
// entry is the value of the name attribute under module in the module.json5 file.
// ets indicates the programming language in use.
// entry is the value of the name attribute under module in the module.json5 file, and ets indicates the programming language in use.
// The script URL is related to the level of the workers directory where the worker file is located and is irrelevant to the file where the new worker is located.
```
Depending on whether the worker script directory and **pages** directory are at the same level, you may need to configure the **buildOption** attribute in the **build-profile.json5** file.
Depending on whether the **workers** directory and **pages** directory are at the same level, you may need to configure the **buildOption** attribute in the **build-profile.json5** file.
(1) The worker script directory and **pages** directory are at the same level.
(1) The **workers** directory and **pages** directory are at the same level.
In the FA model:
...
...
@@ -125,7 +125,7 @@ In the stage model:
}
```
(2) The worker script directory and **pages** directory are at different levels.
(2) The **workers** directory and **pages** directory are at different levels.
In the FA model:
...
...
@@ -586,6 +586,15 @@ For details about the error codes, see [Utils Error Codes](../errorcodes/errorco
| type | string | Yes | Type of the event for which the event listener is to be removed. |
| callback | [WorkerEventListener](#workereventlistener9) | No| Callback to invoke when an event of the specified type occurs. |
| callback | [WorkerEventListener](#workereventlistener9) | No| Callback to invoke when an event of the specified type occurs. Callback of the event listener to remove.|
**Error codes**
...
...
@@ -752,6 +761,15 @@ For details about the error codes, see [Utils Error Codes](../errorcodes/errorco
// For the script URL "entry/ets/workers/worker.ts" in the stage model:
// entry is the value of the name attribute under module in the module.json5 file.
// ets indicates the programming language in use.
```
Depending on whether the worker script directory and **pages** directory are at the same level, you may need to configure the **buildOption** attribute in the **build-profile.json5** file.
Depending on whether the **workers** directory and **pages** directory are at the same level, you may need to configure the **buildOption** attribute in the **build-profile.json5** file.
(1) The worker script directory and **pages** directory are at the same level.
(1) The **workers** directory and **pages** directory are at the same level.
In the FA model:
...
...
@@ -1207,7 +1225,7 @@ In the stage model:
}
}
```
(2) The worker script directory and **pages** directory are at different levels.
(2) The **workers** directory and **pages** directory are at different levels.
In the FA model:
```json
...
...
@@ -1594,6 +1612,14 @@ Dispatches the event defined for the worker thread.