-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
类型应该是MaybeRef #5093
Comments
传给 |
那样就无法响应式了。 场景:dialog 弹出时loading为true,button呈现loading;此时调用异步逻辑,有回调后要使loading关闭。用ref是能实现场景的需求,但ts报type类型错误。 |
create 方法会返回一个 reactive 包裹的 options,你可以直接改,例如: const dialog = useDialog()
const d = dialog.create({})
d.loading = true |
This issue does not have any recent activity. If you are still experiencing similar problems, open a new error, including a minimal copy of the problem |
TuSimple/naive-ui version (版本)
2.34.4
Vue version (Vue 版本)
3.3.4
Browser and its version (浏览器及其版本)
Chrome 114.0.5735.198
System and its version (系统及其版本)
macOS 13.2.1
Node version (Node 版本)
Reappearance link (重现链接)
https://www.naiveui.com/zh-CN/os-theme/components/dialog#useDialog-API
Reappearance steps (重现步骤)
Expected results (期望的结果)
loading 类型提示正确
Actual results (实际的结果)
不能将类型“Ref”分配给类型“boolean | undefined”。ts(2322)
Remarks (补充说明)
The text was updated successfully, but these errors were encountered: