avatar 降低点错概率

This commit is contained in:
2023-10-07 02:01:22 +08:00
parent 7e50b901c9
commit da79d6d4d7
1 changed files with 53 additions and 63 deletions

View File

@ -225,15 +225,7 @@ export default class ClientList {
add(item) {
this.element.appendChild(ListItem({
id: item.id,
onclick: event => {
},
children: [
Avatar({
src: item.avatar ?? '/favicon.ico',
onclick: event => {
event.stopPropagation()
// 点击插入一个弹出层
document.body.appendChild(Dialog({
onclick: event => document.body.appendChild(Dialog({
children: [
Avatar({
src: item.avatar ?? '/favicon.ico',
@ -246,7 +238,6 @@ export default class ClientList {
cursor: 'pointer'
},
onclick: event => {
// 点击上传图片
console.log('点击上传图片')
const input = document.createElement('input')
input.type = 'file'
@ -284,14 +275,13 @@ export default class ClientList {
}
})
]
}))
}
})),
children: [
Avatar({
src: item.avatar ?? '/favicon.ico'
}),
Span({
textContent: item.name ?? item.id,
onclick: event => {
event.stopPropagation()
}
textContent: item.name ?? item.id
})
]
}))