使用 flex 布局水平滚动时,如何使行中的第一列具有粘性?
.wrapper {
display: flex;
height: 100vh;
overflow-x: auto
}
.first-column {
flex: 1 0 300px;
background: gray;
}
.second-column {
flex: 0 0 auto;
padding: 20px;
overflow: auto;
}Run Code Online (Sandbox Code Playgroud)
<div class="wrapper">
<div class="first-column">
<blockquote><i>Please, make me fixed!</i></blockquote>
</div>
<div class="second-column">
hello How are u?hello How are u?hello How are u?hello How are u?hello How are u?hello How are u?hello How are u?hello How are u?hello How are u?hello How are u?hello How are u?hello How are u?hello …Run Code Online (Sandbox Code Playgroud)我必须根据它们的状态属性对我的对象数组进行排序
例如,我有以下数组
[
{userName:"One", status:"Live"},
{userName:"Two", status:"Rejected"},
{userName:"Three", status:"To Do"},
{userName:"Four", status:"Verify"},
{userName:"Five", status:"Received"},
{userName:"Six", status:"In Progress"}
]
Run Code Online (Sandbox Code Playgroud)
排序后,我需要一个看起来像的数组
[
{userName:"Three", status:"To Do"},
{userName:"Five", status:"Received"},
{userName:"Six", status:"In Progress"},
{userName:"Two", status:"Rejected"},
{userName:"Four", status:"Verify"},
{userName:"One", status:"Live"}
]
Run Code Online (Sandbox Code Playgroud)
需要根据其状态属性按以下顺序对项目进行排序
可以有多个具有相同状态的项目。