zheng 18 saat önce
ebeveyn
işleme
ab309fc9a4

+ 27 - 0
19.React/高阶/project1/src/components/Clock.jsx

@@ -0,0 +1,27 @@
+// 时间
+// 类组件
+import {Component} from 'react';
+class Clock extends Component {
+    showMain() {
+        console.log("出現1")
+    }
+    /**
+     * 页面:
+     * 1.显示初始时间
+     * 2.添加按钮
+     * 点击按钮出发事件
+     * 点击开始时间
+     * 再点击停止时间
+     * 
+     * @returns 
+     */
+    render() {
+        return (
+            <>
+                <h1>时钟</h1>
+                <button onClick={this.showMain}>點我</button>
+            </>
+        )
+    }
+}
+export default Clock;

+ 10 - 0
19.React/高阶/project1/src/components/Count.jsx

@@ -0,0 +1,10 @@
+// 计数器
+// 函数组件
+/**
+ * 计数器
+ * 显示初始值 
+ * 增加按钮
+ * 减少按钮
+ * 双倍增加
+ * 双倍减少
+ */