fix(v-model): consistent nullish value handling with 2.x (#1530)

fix #1528
This commit is contained in:
underfin
2020-07-07 07:02:33 +08:00
committed by GitHub
parent 441c23602f
commit 425335c28b
2 changed files with 7 additions and 2 deletions

View File

@@ -48,6 +48,7 @@ describe('vModel', () => {
const input = root.querySelector('input')!
const data = root._vnode.component.data
expect(input.value).toEqual('')
input.value = 'foo'
triggerEvent('input', input)
@@ -57,6 +58,10 @@ describe('vModel', () => {
data.value = 'bar'
await nextTick()
expect(input.value).toEqual('bar')
data.value = undefined
await nextTick()
expect(input.value).toEqual('')
})
it('should work with multiple listeners', async () => {