Skip to content
New issue

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

Bug: clear-icon slotProps has type error #842

Closed
mikinovation opened this issue Apr 22, 2024 · 1 comment
Closed

Bug: clear-icon slotProps has type error #842

mikinovation opened this issue Apr 22, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@mikinovation
Copy link

Describe the bug

app.vue:10:28 - error TS2493: Tuple type '[]' of length '0' has no element at index '0'.

10     <template #clear-icon="{ clear }">
                              ~~~~~~~~~

app.vue:10:30 - error TS2339: Property 'clear' does not exist on type 'undefined'.

10     <template #clear-icon="{ clear }">
                                ~~~~~

To Reproduce

This is the minimalized project.

https://github.com/mikinovation/sandbox/tree/main/vue/nuxt-vuedatepicker

You can check type error

pnpm install
pnpm typecheck

Expected behavior

the props should have "clear" function

@mikinovation mikinovation added awaiting triage The issue is not reviewed by the maintainers bug Something isn't working labels Apr 22, 2024
@mikinovation
Copy link
Author

I tried to fix this problem and added this code to DatepickerInput.vue
However it doesn't work.

defineSlots<{
        trigger: any;
        ['dp-input'](): any;
        ['clear-icon'](props: { clear: (ev?: Event) => void }): any;
        ['input-icon'](): any;
    }>();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants