Skip to content

Commit a523085

Browse files
Jinjiangeddyerburgh
authored andcommitted
docs(zh): update translation (#1194)
1 parent a433c91 commit a523085

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

docs/zh/api/options.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# 挂载选项
22

3-
`mount``shallowMount` 的选项。该对象同时包含了 Vue Test Utils 挂载选项和其它选项。
3+
`mount``shallowMount` 的选项。
4+
5+
:::tip
6+
除了下方列出的选项,`options` 对象还可以包含任何 `new Vue ({ /*options here*/ })` 调用时的有效选项。
7+
当通过 `mount` / `shallowMount` 挂载时,这些选项将会合并入组件现有的选项中。
8+
9+
[查阅其它选项的例子](#其它选项)
10+
:::
411

512
- [`context`](#context)
613
- [`slots`](#slots)
@@ -199,6 +206,8 @@ expect(wrapper.vm.$route).toBeInstanceOf(Object)
199206

200207
当设为 `true` 时,组件在渲染时将会挂载到 DOM 上。
201208

209+
如果添加到了 DOM 上,你应该在测试的最后调用 `wrapper.destroy()` 将元素从文档中移除并销毁组件实例。
210+
202211
## attrs
203212

204213
- 类型:`Object`

docs/zh/api/wrapper/destroy.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ mount({
1717
}).destroy()
1818
expect(spy.calledOnce).toBe(true)
1919
```
20+
21+
如果挂载时 `attachToDocument` 被设为 `true`,则组件的 DOM 元素也将会从文档中被移除。
22+
23+
对于函数式组件来说,`destroy` 只会从文档中移除渲染出来的 DOM 元素。

docs/zh/guides/testing-single-file-components-with-jest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ Jest 可以被用来生成多种格式的测试覆盖率报告。以下是一个
155155

156156
### 测试规范示例
157157

158-
如果你已经熟悉了 Jasmine,你应该很适应 Jest 的[断言 API](https://jestjs.io/docs/zh-Hans/expect.htm)
158+
如果你已经熟悉了 Jasmine,你应该很适应 Jest 的[断言 API](https://jestjs.io/docs/zh-Hans/expect)
159159

160160
```js
161161
import { mount } from '@vue/test-utils'

0 commit comments

Comments
 (0)