fix(runtime-core): use consistent camelCase event casing for render functions (#2278)

close #2249
This commit is contained in:
shadowings-zy
2020-10-07 06:28:56 +08:00
committed by GitHub
parent 390589ec6d
commit 62f26173ba
3 changed files with 42 additions and 7 deletions

View File

@@ -28,6 +28,24 @@ describe('component: emit', () => {
expect(onBaz).toHaveBeenCalled()
})
test('trigger camelize event', () => {
const Foo = defineComponent({
render() {},
created() {
this.$emit('test-event')
}
})
const fooSpy = jest.fn()
const Comp = () =>
h(Foo, {
onTestEvent: fooSpy
})
render(h(Comp), nodeOps.createElement('div'))
expect(fooSpy).toHaveBeenCalled()
})
// for v-model:foo-bar usage in DOM templates
test('trigger hyphenated events for update:xxx events', () => {
const Foo = defineComponent({