generated from arvinxx/npm-template
-
Notifications
You must be signed in to change notification settings - Fork 103
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
长文本是否可以折叠?👑 [需求] #158
Labels
documentation
Improvements or additions to documentation
Comments
ChatItemRender -> ContentRender |
这个怎么控制呢?现在用哪个接口能实现类似的效果? |
自动折叠感觉是个业务逻辑,我理解这个逻辑你可以在 render 里面去写,例如 const [open,setOpen] = useState(false)
useEffect(()=>{
// 这里写你的什么时候展开/缩略的逻辑
if(xxxx){
setOpen(true)
}
},[])
// Components
chatItemRenderConfig={{
contentRender: (_, defaultContent) => {
return (
< Collapse
open={open}
>
{defaultContent}
</Collapse >
);
},
}} |
这个确实是个业务需求。
不过照着这个逻辑来说,可能是某类消息过长的时候才需要折叠~
好像用上面这个没办法判断了~
其实我更想要的应该是配置每个Item的折叠规则~
发自我的iPhone
…------------------ 原始邮件 ------------------
发件人: Shinji-Li ***@***.***>
发送时间: 2024年4月9日 15:06
收件人: ant-design/pro-chat ***@***.***>
抄送: 李国宝 ***@***.***>, Author ***@***.***>
主题: Re: [ant-design/pro-chat] 长文本是否可以折叠?�� [需求] (Issue #158)
自动折叠感觉是个业务逻辑,我理解这个逻辑你可以在 render 里面去写,例如
const [open,setOpen] = useState(false) useEffect(()=>{ // 这里写你的什么时候展开/缩略的逻辑 if(xxxx){ setOpen(true) } },[]) // Components chatItemRenderConfig={{ contentRender: (_, defaultContent) => { return ( < Collapse open={open} > {defaultContent} </Collapse > ); }, }}
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
文本太长了,想给个自动折叠的效果。
The text was updated successfully, but these errors were encountered: