Commit 3af50164 authored by Alan 张加强's avatar Alan 张加强

update

parent d3ed529c
/*
* @Author: your name
* @Date: 2020-06-19 16:41:51
* @LastEditTime: 2020-06-19 16:42:20
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \dva-jingzi-game\src\component\box.js
*/
import styled from 'styled-components'; import styled from 'styled-components';
import WinImg from './winImg'; import WinImg from './winImg';
const Box = styled.div ` const Box = styled.div `
...@@ -26,6 +34,8 @@ function BoxMaster(props) { ...@@ -26,6 +34,8 @@ function BoxMaster(props) {
flag: value.nowFliage, flag: value.nowFliage,
}) })
// 保存每一步操作 // 保存每一步操作
console.log("11");
props.dispatch({ props.dispatch({
type: 'main/saveActionFn', type: 'main/saveActionFn',
id: value.value, id: value.value,
...@@ -47,16 +57,21 @@ function BoxMaster(props) { ...@@ -47,16 +57,21 @@ function BoxMaster(props) {
} }
return ( return ( <
<Box onClick={ () => handelClick(props)} style={{background:props.winner && props.value === props.winner.value ?"":props.color}}> Box onClick = {
{ () => handelClick(props)
props.winner && props.value === props.winner.value ? (
<WinImg flag={props.flag} />
) : (<span>{props.flag}</span>)
} }
</Box> style = {
{ background: props.winner && props.value === props.winner.value ? "" : props.color }
} > {
props.winner && props.value === props.winner.value ? ( <
WinImg flag = { props.flag }
/>
) : ( < span > { props.flag } < /span>)
} <
/Box>
) )
} }
export default BoxMaster export default BoxMaster
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment