ant-design-vue
ant-design-vue copied to clipboard
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.
- [ ] I have searched the issues of this repository and believe that this is not a duplicate.
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 <ATooltip key="copy" title="" > at <App>
同样遇到了,请问解决了吗
检查Typography 组件 源码 发现在onMounted生命周期里面调用了 syncEllipsis 方法 这个方法中使用了slots 所以会报这个警告,注释掉这个方法就不会有警告, 而且功能正常,希望作者能在下个版本更新能修复这个问题
能提供一些复现的代码吗?
这样使用 @cc-hearts
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days