Skip to content

Commit 69a8cd8

Browse files
committed
docs: update setData docs to reflect async mode
1 parent 159971d commit 69a8cd8

File tree

4 files changed

+20
-12
lines changed

4 files changed

+20
-12
lines changed

docs/api/wrapper/setData.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ setData works by recursively calling Vue.set.
1616
import { mount } from '@vue/test-utils'
1717
import Foo from './Foo.vue'
1818

19-
const wrapper = mount(Foo)
20-
wrapper.setData({ foo: 'bar' })
21-
expect(wrapper.vm.foo).toBe('bar')
19+
test('setData demo', async () => {
20+
const wrapper = mount(Foo)
21+
await wrapper.setData({ foo: 'bar' })
22+
expect(wrapper.vm.foo).toBe('bar')
23+
})
2224
```

docs/ja/api/wrapper/setData.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ setData は再帰的に Vue.set を実行することで動作します。
1616
import { mount } from '@vue/test-utils'
1717
import Foo from './Foo.vue'
1818

19-
const wrapper = mount(Foo)
20-
wrapper.setData({ foo: 'bar' })
21-
expect(wrapper.vm.foo).toBe('bar')
19+
test('setData demo', async () => {
20+
const wrapper = mount(Foo)
21+
await wrapper.setData({ foo: 'bar' })
22+
expect(wrapper.vm.foo).toBe('bar')
23+
})
2224
```

docs/ru/api/wrapper/setData.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ setData работает путём слияния существующих св
1818
import { mount } from '@vue/test-utils'
1919
import Foo from './Foo.vue'
2020

21-
const wrapper = mount(Foo)
22-
wrapper.setData({ foo: 'bar' })
23-
expect(wrapper.vm.foo).toBe('bar')
21+
test('setData demo', async () => {
22+
const wrapper = mount(Foo)
23+
await wrapper.setData({ foo: 'bar' })
24+
expect(wrapper.vm.foo).toBe('bar')
25+
})
2426
```

docs/zh/api/wrapper/setData.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
import { mount } from '@vue/test-utils'
1717
import Foo from './Foo.vue'
1818

19-
const wrapper = mount(Foo)
20-
wrapper.setData({ foo: 'bar' })
21-
expect(wrapper.vm.foo).toBe('bar')
19+
test('setData demo', async () => {
20+
const wrapper = mount(Foo)
21+
await wrapper.setData({ foo: 'bar' })
22+
expect(wrapper.vm.foo).toBe('bar')
23+
})
2224
```

0 commit comments

Comments
 (0)