小编ebi*_*bin的帖子

使用 flex 布局水平滚动时,如何使行中的第一列具有粘性?

使用 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)

css position flexbox

3
推荐指数
1
解决办法
4217
查看次数

根据它们的状态属性对我的对象数组进行自定义排序

我必须根据它们的状态属性对我的对象数组进行排序

例如,我有以下数组

[
{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)

需要根据其状态属性按以下顺序对项目进行排序

  1. 去做
  2. 已收到
  3. 进行中
  4. 拒绝了
  5. 核实
  6. 居住

可以有多个具有相同状态的项目。

javascript

-1
推荐指数
1
解决办法
2014
查看次数

标签 统计

css ×1

flexbox ×1

javascript ×1

position ×1