Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 418 Bytes

update.md

File metadata and controls

19 lines (14 loc) · 418 Bytes

update()

强制根 Vue 组件重渲染。

如果在包含一个 vmWrapper 上调用,则会强制 Wrapper vm 重渲染。

  • 示例:
import { mount } from '@vue/test-utils'
import { expect } from 'chai'
import Foo from './Foo.vue'

const wrapper = mount(Foo)
expect(wrapper.vm.bar).toBe('bar')
wrapper.vm.bar = 'new value'
wrapper.update()
expect(wrapper.vm.bar).toBe('new value')