CSS 使人抓狂

This commit is contained in:
CrescentLeaf
2025-04-20 00:58:52 +08:00
parent 65ff48dabc
commit f305225eb3
8 changed files with 242 additions and 28 deletions

View File

@@ -0,0 +1,16 @@
import Avatar from "../Avatar.js"
export default function ContactsListItem({ nickName, avatar }) {
return (
<mdui-list-item rounded style={{
marginTop: '3px',
marginBottom: '3px',
width: '100%',
}}>
<span style={{
width: "100%",
}}>{nickName}</span>
<Avatar src={avatar} text="title" slot="icon" />
</mdui-list-item>
)
}

View File

@@ -1,17 +1,17 @@
import Avatar from "../Avatar.js"
export default function RecentsListItem({ title, avatar, content }) {
export default function RecentsListItem({ nickName, avatar, content }) {
return (
<mdui-list-item rounded style={{
marginTop: '3px',
marginBottom: '3px',
}}>
{title}
<Avatar src={avatar} text="title" slot="icon" />
{nickName}
<Avatar src={avatar} text={nickName} slot="icon" />
<span slot="description"
style={{
display: "inline-block", /* 或者 block */
maxWidth: "100%", /* 或者固定宽度如 200px */
width: "100%",
display: "inline-block",
whiteSpace: "nowrap", /* 禁止换行 */
overflow: "hidden", /* 隐藏溢出内容 */
textOverflow: "ellipsis", /* 显示省略号 */