Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 484 Bytes

setValue.md

File metadata and controls

26 lines (18 loc) · 484 Bytes

setValue(value)

Sets value of a text-control input element and updates v-model bound data.

  • Arguments:

    • {String} value
  • Example:

import { mount } from '@vue/test-utils'
import Foo from './Foo.vue'

const wrapper = mount(Foo)
const input = wrapper.find('input[type="text"]')
input.setValue('some value')
  • Note:

textInput.setValue(value) is an alias of the following code.

textInput.element.value = value
textInput.trigger('input')