Skip to content

Commit b7d9256

Browse files
committed
docs(cn):translate src/content/api/hot-module-replacement.md
1 parent 75128c9 commit b7d9256

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

src/content/api/hot-module-replacement.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -224,14 +224,14 @@ module.hot.apply(options).then(outdatedModules => {
224224

225225
可选的 `options` 对象可以包含以下属性:
226226

227-
- `ignoreUnaccepted` (boolean): Ignore changes made to unaccepted modules.
228-
- `ignoreDeclined` (boolean): Ignore changes made to declined modules.
229-
- `ignoreErrored` (boolean): Ignore errors thrown in accept handlers, error handlers and while reevaluating module.
230-
- `onDeclined` (function(info)): Notifier for declined modules
231-
- `onUnaccepted` (function(info)): Notifier for unaccepted modules
232-
- `onAccepted` (function(info)): Notifier for accepted modules
233-
- `onDisposed` (function(info)): Notifier for disposed modules
234-
- `onErrored` (function(info)): Notifier for errors
227+
- `ignoreUnaccepted` (boolean): 忽略对不可接受的模块所做的更改。
228+
- `ignoreDeclined` (boolean): 忽略对已拒绝的模块所做的更改。
229+
- `ignoreErrored` (boolean): 忽略在接受处理程序、错误处理程序以及重新评估模块时抛出的错误。
230+
- `onDeclined` (function(info)): 拒绝模块的通知者。
231+
- `onUnaccepted` (function(info)): 不可接受的模块的通知程序。
232+
- `onAccepted` (function(info)): 可接受模块的通知者。
233+
- `onDisposed` (function(info)): 废弃模块的通知者。
234+
- `onErrored` (function(info)): 错误通知者。
235235

236236
`info` 参数将是一个包含以下某些值的对象:
237237

@@ -243,17 +243,17 @@ module.hot.apply(options).then(outdatedModules => {
243243
'unaccepted' | 'accepted' |
244244
'disposed' | 'accept-errored' |
245245
'self-accept-errored' | 'self-accept-error-handler-errored',
246-
moduleId: 4, // The module in question.
247-
dependencyId: 3, // For errors: the module id owning the accept handler.
248-
chain: [1, 2, 3, 4], // For declined/accepted/unaccepted: the chain from where the update was propagated.
249-
parentId: 5, // For declined: the module id of the declining parent
250-
outdatedModules: [1, 2, 3, 4], // For accepted: the modules that are outdated and will be disposed
251-
outdatedDependencies: { // For accepted: The location of accept handlers that will handle the update
246+
moduleId: 4, // 有问题的模块。
247+
dependencyId: 3, // 对于错误:拥有接受处理程序的模块 ID。
248+
chain: [1, 2, 3, 4], // 对于拒绝/接受/不接受:传播更新的 `chain`。
249+
parentId: 5, // 对于拒绝:下降的父模块 ID。
250+
outdatedModules: [1, 2, 3, 4], // 对于接受:已过时且将被处置的模块。
251+
outdatedDependencies: { // 对于接受:将处理更新的接受处理程序的位置。
252252
5: [4]
253253
},
254-
error: new Error(...), // For errors: the thrown error
255-
originalError: new Error(...) // For self-accept-error-handler-errored:
256-
// the error thrown by the module before the error handler tried to handle it.
254+
error: new Error(...), // 对于错误:抛出错误
255+
originalError: new Error(...) // 对于自我接受错误处理程序错误:
256+
// 在错误处理程序尝试处理该模块之前,该模块引发的错误。
257257
}
258258
```
259259

0 commit comments

Comments
 (0)