Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 744 Bytes

setData.md

File metadata and controls

22 lines (16 loc) · 744 Bytes

setData(data)

⚠Cette page est actuellement en cours de traduction française. Vous pouvez repasser plus tard ou participer à la traduction de celle-ci dès maintenant !

Sets `Wrapper` `vm` data and forces update on each `Wrapper` in `WrapperArray`.

Note every Wrapper must contain a Vue instance.

  • Arguments:

    • {Object} data
  • Example:

import { mount } from 'vue-test-utils'
import { expect } from 'chai'
import Foo from './Foo.vue'
import Bar from './Bar.vue'

const wrapper = mount(Foo)
const barArray = wrapper.findAll(Bar)
barArray.setData({ foo: 'bar' })
expect(barArray.at(0).vm.foo).toBe('bar')