小编Bas*_*Bas的帖子

redux 工具包减速器具有多个参数?还原工具包

鉴于这种

export const slice = createSlice({
    name: 'reducer',
    initialState: {

    },
    reducers: {
       test: (state, action) => {
           console.log(action.payload) // 1
       } 

    },

})
Run Code Online (Sandbox Code Playgroud)

然后我运行这个

dispatch(test(1,2,3,4,5,6,7)) 
Run Code Online (Sandbox Code Playgroud)

action.payload只是第一个参数。怎样才能得到另外6个呢?

reactjs react-redux redux-toolkit

11
推荐指数
2
解决办法
1万
查看次数

CSS Flexbox 具有位置绝对混淆

我很困惑这是如何工作的,有人能告诉我到底发生了什么吗?

body,
html {
  padding: 0;
  margin: 0;
  height: 100vh;
  width: 100%;
}

.chat-break {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;

}

.chat-break .line {
  border-bottom: 1px solid #ddd;
  width: 100%;
}

.chat-break .date {
  color: #B5B5B5;
  position: absolute;
  background-color: #fff;
  padding-left: 8px;
  padding-right: 8px;
  
}
Run Code Online (Sandbox Code Playgroud)
<div class="chat-break">
    <div class="line">
    </div>
    
    <p class="date">Today</p>
</div>
  
Run Code Online (Sandbox Code Playgroud)

我的理解:

  • .chat-breakflexbox 有两个元素.line.date
  • ...但是在弹性盒内使用position: absolute.date不再是它自己的元素之后?
  • 那为什么“今天”会在线居中呢?

css

4
推荐指数
1
解决办法
2930
查看次数

标签 统计

css ×1

react-redux ×1

reactjs ×1

redux-toolkit ×1