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

unref返回数据类型异常 #8747

Closed
tetezi opened this issue Jul 10, 2023 · 0 comments · Fixed by #8748
Closed

unref返回数据类型异常 #8747

tetezi opened this issue Jul 10, 2023 · 0 comments · Fixed by #8748

Comments

@tetezi
Copy link

tetezi commented Jul 10, 2023

Vue version

3.3.4

Link to minimal reproduction

https://play.vuejs.org/#eNp9kEFPwzAMhf+Klcs2qRpCu03bJEA7wAHQ4JhL6dzSrXWixNkmdf3vOC0dOwCHSNZ7z85nN+rO2ukhoJqrhc9caRk8crBQpVQstWKv1UpTWVvjGBoI5DCH5MHUNjBuN5gn8lrInalhJINGmjJDnoHR8xwo1B/oln3fGG4h9VLvyRwJYj2G78gZZM6ir1dwhqsfBnUCE02Lmx5zpRKBk6/yspjuvCHZoNEyVKtMWssK3YvlUlC0mkPnRC+tKnN86jR2AZNBzz4x2/+i7/wpalq9OvToDqjVxePUFci9vX57xpPUF7M221BJ+h9zg95UITL2sftAW8G+ynW0j93tSyre/frESH5YKoLGZNvltZLrx6v9tfoP7mw66/o0tar9AmJKqyI=

Steps to reproduce

const a: number= unref( 1 as unknown as ( number| Ref | ComputedRef) )

What is expected?

unref(data) 返回number 类型

What is actually happening?

unref(data) 返回number | ComputedRef ,因此报错不能将类型“number | ComputedRef”分配给类型“number”。

System Info

No response

Any additional comments?

unref参数同时存在ComputedRef,Ref,原类型的时候,返回参数类型会异常。

@tetezi tetezi closed this as completed Aug 4, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Sep 6, 2023
yyx990803 pushed a commit that referenced this issue Nov 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant