Skip to content

Commit

Permalink
fix(useVModel): types for emits, close #316
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Jan 31, 2021
1 parent 752d791 commit fe04735
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/useVModel/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import { computed, getCurrentInstance, isVue2 } from 'vue-demi'
* @param key (default 'value' in Vue 2 and 'modelValue' in Vue 3)
* @param emit
*/
export function useVModel<P extends object, K extends keyof P>(
export function useVModel<P extends object, K extends keyof P, Name extends string>(
props: P,
key?: K,
emit?: (name: string, value: any) => void,
emit?: (name: Name, ...args: any[]) => void,
) {
const vm = getCurrentInstance()
// @ts-expect-error mis-alignment with @vue/composition-api
Expand Down

0 comments on commit fe04735

Please sign in to comment.