@@ -60,7 +60,7 @@ const wrapper = mount(Component, {
60
60
61
61
#### options .global
62
62
63
- 组件状态中 ,你可以通过 [` MountingOptions.global ` 配置属性](#global )配置上述 Vue 3 应用程序。这对于提供组件期望可用的模拟值非常有用。
63
+ 在组件状态中 ,你可以通过 [` MountingOptions.global ` 配置属性](#global )配置上述 Vue 3 应用程序。这对于提供组件期望可用的模拟值非常有用。
64
64
65
65
::: tip
66
66
如果你发现自己需要为许多测试设置共同的应用配置,则可以使用导出的 [` config ` 对象](#config )为整个测试套件设置配置。
@@ -1152,7 +1152,7 @@ export default {
1152
1152
</script>
1153
1153
` ` `
1154
1154
1155
- ` Component.spec.js `
1155
+ ` Component.spec.js ` :
1156
1156
1157
1157
` ` ` js
1158
1158
import { mount } from '@vue/test-utils'
@@ -1163,7 +1163,7 @@ import Foo from '@/Foo.vue'
1163
1163
test('findComponent', () => {
1164
1164
const wrapper = mount(Component)
1165
1165
1166
- // All the following queries would return a VueWrapper
1166
+ // 所有以下查询将返回一个 VueWrapper
1167
1167
1168
1168
wrapper.findComponent('.foo')
1169
1169
wrapper.findComponent('[data-test="foo"]')
@@ -1257,7 +1257,7 @@ import Component from './Component.vue'
1257
1257
test('findAllComponents', () => {
1258
1258
const wrapper = mount(Component)
1259
1259
1260
- // Returns an array of VueWrapper
1260
+ // 返回一个 VueWrapper 数组
1261
1261
wrapper.findAllComponents('[data-test="number"]')
1262
1262
})
1263
1263
` ` `
@@ -1363,7 +1363,7 @@ export default {
1363
1363
</script>
1364
1364
` ` `
1365
1365
1366
- ` Component.spec.js `
1366
+ ` Component.spec.js ` :
1367
1367
1368
1368
` ` ` js
1369
1369
import { mount } from '@vue/test-utils'
@@ -1602,7 +1602,7 @@ export default {
1602
1602
</script>
1603
1603
` ` `
1604
1604
1605
- ` Component.spec.js `
1605
+ ` Component.spec.js ` :
1606
1606
1607
1607
` ` ` js
1608
1608
import { mount } from '@vue/test-utils'
@@ -1852,7 +1852,7 @@ test('unmount', () => {
1852
1852
})
1853
1853
` ` `
1854
1854
1855
- ## Wrapper properties
1855
+ ## Wrapper 属性
1856
1856
1857
1857
### vm
1858
1858
@@ -1954,7 +1954,7 @@ type GlobalMountOptions = {
1954
1954
1955
1955
你可以选择在整个测试套件中配置挂载选项,而不是在每个测试中单独配置。这些配置将在每次 ` mount ` 组件时默认使用。如果需要,你可以在每个测试中覆盖这些默认设置。
1956
1956
1957
- ** Example : **
1957
+ ** 示例: **
1958
1958
1959
1959
全局模拟来可能是自 vue - i18n 的 ` $t ` 变量和一个组件:
1960
1960
@@ -2014,9 +2014,9 @@ test('config.global mocks and stubs', () => {
2014
2014
2015
2015
你可以使用此组件在渲染树中查找 ` router-link ` 组件。
2016
2016
2017
- ** Usage : **
2017
+ ** 用法: **
2018
2018
2019
- 在挂载选项中设置为替换组件 ( stub ) :
2019
+ 在挂载选项中设置为替代组件 :
2020
2020
2021
2021
` ` ` js
2022
2022
import { mount, RouterLinkStub } from '@vue/test-utils'
0 commit comments