We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<script lang="ts"> import { VNode } from 'vue'; declare const MyList: new <T>(props: { readonly dataSource: T[]; readonly 'onItem-click'?: (value: T) => void }) => { $props: typeof props; $scopedSlots: { default?: ({ data, index }: { readonly data: T; readonly index: number }) => VNode[] | undefined; }; }; const console = window.console; </script> <script setup lang="ts"></script> <template> <MyList :data-source="[{ foo: 123, bar: false }]" @item-click="console.log($event)"> <template #default="{ data, index }"> <div>foo: {{ data.foo }}; index: {{ index }}</div> </template> </MyList> </template>
The type of $event is any.
$event
any
If we change 'onItem-click' to 'onItemClick', the type of $event will be { foo: number; bar: boolean; }.
'onItem-click'
'onItemClick'
{ foo: number; bar: boolean; }
Why?
Extra info:
https://v2.vuejs.org/v2/guide/components-custom-events.html
Unlike components and props, event names don’t provide any automatic case transformation.
The text was updated successfully, but these errors were encountered:
6dc54dd
No branches or pull requests
The type of
$event
isany
.If we change
'onItem-click'
to'onItemClick'
, the type of$event
will be{ foo: number; bar: boolean; }
.Why?
Extra info:
https://v2.vuejs.org/v2/guide/components-custom-events.html
The text was updated successfully, but these errors were encountered: