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

$watch callback is not strongly typed, unlike watch which is #6135

Closed
ascott18 opened this issue Jun 17, 2022 · 0 comments · Fixed by #6136
Closed

$watch callback is not strongly typed, unlike watch which is #6135

ascott18 opened this issue Jun 17, 2022 · 0 comments · Fixed by #6136

Comments

@ascott18
Copy link

Vue version

3.2.37

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-mfhxkx?file=src%2Fmain.ts&terminal=dev

Steps to reproduce

Setup a watcher with this.$watch using a function as the source.

What is expected?

The callback's parameters are typed based on the source, like they were in vue2 and like they are with watch.

What is actually happening?

The callback's parameters are typed as any.

System Info

System:
    OS: Windows 10 10.0.19044
    CPU: (16) x64 Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz 
    Memory: 10.02 GB / 31.94 GB
  Binaries:
    Node: 16.15.1 - C:\Program Files\nodejs\node.EXE       
    Yarn: 1.15.2 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 8.11.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 102.0.5005.115
    Edge: Spartan (44.19041.1266.0), Chromium (102.0.1245.41)
    Internet Explorer: 11.0.19041.1566
  npmPackages:
    vue: ^3.2.34 => 3.2.37

Any additional comments?

No response

chrislone pushed a commit to chrislone/core that referenced this issue Feb 4, 2023
zhangzhonghe pushed a commit to zhangzhonghe/core that referenced this issue Apr 12, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Sep 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants