fix(types): fix using tuple type as EmitsOptions (#2160)

fix #2159
This commit is contained in:
wonderful-panda
2020-09-22 23:05:37 +09:00
committed by GitHub
parent 6aa2256913
commit 5dbd6b36a0
2 changed files with 11 additions and 2 deletions

View File

@@ -63,3 +63,12 @@ const Baz: FunctionalComponent<{}, string[]> = (props, { emit }) => {
}
expectType<Component>(Baz)
const Qux: FunctionalComponent<{}, ['foo', 'bar']> = (props, { emit }) => {
emit('foo')
emit('foo', 1, 2)
emit('bar')
emit('bar', 1, 2)
}
expectType<Component>(Qux)