为什么拖动过程中border-radius的圆角消失了(其实好像也没消失),而且好像截取了背景部分来填充圆角?
包含图片子项class
.list_item_pic {
display: flex;
flex-direction: column;
justify-content: flex-end;
border-radius: 3vh;
background-size: cover;
transition: all ease 0.3s;
}
父容器css class:
.playlist_display_area {
overflow-x: auto;
overflow-y: hidden;
box-sizing: border-box;
width: calc(100%);
height: 60vh;
padding: 0 10px;
gap: 10px;
grid-template-columns: repeat(auto-fill, 28vh);
grid-template-rows: repeat(2, 28vh);
/* grid-template-columns: repeat(auto-fill, minmax(28vh, auto));
grid-template-rows: repeat(auto-fill, minmax(28vh, auto)); */
grid-auto-flow: column;
display: grid;
}
React jsx code:
<div className="playlist_display_area">
{playLists?.map((playlist) => {
const songs = playlist.songs;
let listBg = songs[songs.length - 1]?.AlbmPic;
listBg = listBg || this.trackBoxBgArr[getRandomInt(0, 5)];
return (
<div
key={playlist.listId}
className={`list_item_pic ${playlist.boxSize}`}
onContextMenu={(e) =>
this.onContextMenu(e, playlist, playLists)
}
draggable="true"
onDragStart={() => this.handleDragStart(playlist.listId)}
onDrop={(e) => this.ondrop(e, playlist.listId)}
onDragOver={(e) => this.handleDragover(e)}
style={{ backgroundImage: listBg }}
>
<div className="list_inside_label">{playlist.name}</div>
</div>
);
})}
</div>
楼上怎么没放自己的文章呢?如何自定义 drag 样式。还好我前几天看过 🐶
文章内部用
setDragImage
来显示的效果。使用文章内部的办法,可以自定义样式。