vueComponent / ant-design-vue

🌈 An enterprise-class UI components based on Ant Design and Vue. 🐜
https://antdv.com/
Other
19.76k stars 3.72k forks source link

Typography 排版 组件使用时 同时设置 copyable 跟 ellipsis 会出现警告 Slot "default" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead. #7552

Open archiesong opened 1 month ago

archiesong commented 1 month ago

Version

4.1.0

Environment

vue 3.4.23

Reproduction link

https://www.antdv.com/components/typography-cn#api

Steps to reproduce

在项目中使用Typography 组件 <TypographyText :ellipsis="{ tooltip: '提示123232'}" :copyable="{ tooltip: false, text: '1232'}" content="ASD大苏打实打实大苏打实打实大苏打实打实的AS" />

What is expected?

浏览器控制台没有 Vue Warn 警告 提示

What is actually happening?

[Vue warn]: Slot "default" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead. at at

QQ截图20240505030728 QQ截图20240505030752

Jiachenglong2518 commented 2 weeks ago

同样遇到了,请问解决了吗

archiesong commented 1 week ago

image 检查Typography 组件 源码 发现在onMounted生命周期里面调用了 syncEllipsis 方法 这个方法中使用了slots 所以会报这个警告,注释掉这个方法就不会有警告, 而且功能正常,希望作者能在下个版本更新能修复这个问题