郑柏铃 2 өдөр өмнө
parent
commit
8433348a71

+ 3 - 2
20.react/初阶/8.组件传参.html

@@ -24,7 +24,6 @@
             )
             )
         }
         }
 
 
-        // 函数组件 
         /**
         /**
          * 所有函数定义的组件 都会接受一个唯一的参数:props
          * 所有函数定义的组件 都会接受一个唯一的参数:props
          * 和Vue是一样的,是单向数据流
          * 和Vue是一样的,是单向数据流
@@ -36,8 +35,10 @@
          * props 是只读 不可修改
          * props 是只读 不可修改
          * 
          * 
         */
         */
+
+        // 函数组件 
         function Good(props) {
         function Good(props) {
-            props.name = '瑶一瑶';
+            // props.name = '瑶一瑶';
             return <h1>{props.name}</h1>
             return <h1>{props.name}</h1>
         }
         }