diff --git a/src/TicTacToe.js b/src/TicTacToe.js index e50577b..06df2ff 100644 --- a/src/TicTacToe.js +++ b/src/TicTacToe.js @@ -5,18 +5,19 @@ function Square({ row, column, value, clickHandler }) { let buttonClass = "" switch (value){ case "X": - buttonClass = "square bg-amber-200 " + buttonClass = "bg-amber-200 " break; case "O": - buttonClass = "square bg-violet-300" + buttonClass = "bg-violet-300" break; default: - buttonClass = "square bg-white" + buttonClass = "bg-white" break; } return ( - +
+
+ +
+
+ + +
+
- +
) +} + + +const styles = { + square: { + border: '1px solid #999', + float: 'left', + fontSize: '24px', + fontWeight: 'bold', + lineHeight: '34px', + height: '34px', + marginRight: '-1px', + marginTop: '-1px', + padding: '0', + textAlign: 'center', + width: '34px', + }, + } \ No newline at end of file diff --git a/src/TodoList.tsx b/src/TodoList.tsx index e208ed5..b49bd82 100644 --- a/src/TodoList.tsx +++ b/src/TodoList.tsx @@ -30,6 +30,20 @@ function TodoItems({ items, setItems }: { {item.name}
+ { // 删除逻辑 + item.isFinished ? + + : <>} - { item.isFinished ? - - : <>}
@@ -106,12 +110,12 @@ const TodoList = () => { const [items, setItems] = useState(exampleTodoItems) return ( -
-

简单TODO

-
+
+

简单TODO

+
-
+
diff --git a/src/styles.css b/src/styles.css index 99d6509..b5c61c9 100644 --- a/src/styles.css +++ b/src/styles.css @@ -1,99 +1,3 @@ @tailwind base; @tailwind components; @tailwind utilities; - -* { - box-sizing: border-box; -} - -body { - font-family: sans-serif; - margin: 20px; - padding: 0; -} - -h1 { - margin-top: 0; - font-size: 22px; -} - -h2 { - margin-top: 0; - font-size: 20px; -} - -h3 { - margin-top: 0; - font-size: 18px; -} - -h4 { - margin-top: 0; - font-size: 16px; -} - -h5 { - margin-top: 0; - font-size: 14px; -} - -h6 { - margin-top: 0; - font-size: 12px; -} - -code { - font-size: 1.2em; -} - -ul { - padding-inline-start: 20px; -} - -* { - box-sizing: border-box; -} - -body { - font-family: sans-serif; - margin: 20px; - padding: 0; -} - -.square { - border: 1px solid #999; - float: left; - font-size: 24px; - font-weight: bold; - line-height: 34px; - height: 34px; - margin-right: -1px; - margin-top: -1px; - padding: 0; - text-align: center; - width: 34px; -} - -.board-row:after { - clear: both; - content: ''; - display: table; -} - -.status { - margin-bottom: 10px; -} -.game { - display: flex; - flex-direction: row; -} - -.game-info { - margin-left: 20px; -} - -.arrow { - font-size: '20px'; - padding: '10px'; - cursor: 'pointer'; -} \ No newline at end of file