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

Parameter 'context' implicitly has an 'any' type #10880

Open
zch233 opened this issue May 7, 2024 · 2 comments
Open

Parameter 'context' implicitly has an 'any' type #10880

zch233 opened this issue May 7, 2024 · 2 comments

Comments

@zch233
Copy link

zch233 commented May 7, 2024

Vue version

3.4.21

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-rcbytc?file=src%2Fcomponents%2FHelloWorld.tsx

Steps to reproduce

when i used Function Signature with error

image

What is expected?

No errors

What is actually happening?

Parameter 'context' implicitly has an 'any' type

System Info

System:
    OS: macOS 13.6.7
    CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
    Memory: 29.79 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 21.7.3 - ~/.nvm/versions/node/v21.7.3/bin/node
    npm: 10.5.0 - ~/.nvm/versions/node/v21.7.3/bin/npm
    pnpm: 9.0.6 - /usr/local/bin/pnpm
    bun: 1.0.25 - ~/.bun/bin/bun
  npmPackages:
    vue: ^3.4.21 => 3.4.21

Any additional comments?

No response

@kRaviteja7
Copy link

hi,
can i work on this issue?

@kRaviteja7
Copy link

Try this it's working,
This issue file is not presented in the project?

import { ref, defineComponent, SetupContext } from 'vue';

export default defineComponent(
<T extends string | number>(props: { msg: T; list: T[] }, context: SetupContext) => {
const count = ref(0);
console.log(props, context),

return () => {
  return <div>{count.value}</div>;
};

},
{
props: ['msg', 'list'],
}
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants