未验证 提交 1fa5ffff 编写于 作者: 小马奔腾 提交者: Gitee

Modify the example

Modify the example

https://gitee.com/openharmony/docs/issues/I645RHSigned-off-by: N小马奔腾 <maxiaodong16@huawei.com>
上级 25d92f56
...@@ -423,7 +423,7 @@ dispatchEvent(event: Event): boolean ...@@ -423,7 +423,7 @@ dispatchEvent(event: Event): boolean
```js ```js
const workerInstance = new worker.ThreadWorker("workers/worker.js"); const workerInstance = new worker.ThreadWorker("workers/worker.js");
workerInstance.dispatchEvent({type: "alert"}); workerInstance.dispatchEvent({type: "alert", timeStamp:0});
``` ```
...@@ -1424,7 +1424,7 @@ workerInstance.onmessage = function(d) { ...@@ -1424,7 +1424,7 @@ workerInstance.onmessage = function(d) {
import worker from '@ohos.worker'; import worker from '@ohos.worker';
const parentPort = worker.workerPort; const parentPort = worker.workerPort;
class MyModel { class MyModel {
name:"undefined" name = "undefined"
Init() { Init() {
this.name = "MyModel" this.name = "MyModel"
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册