2 回答

TA貢獻1872條經驗 獲得超4個贊
回調,是非?;镜母拍睿绕湓诂F今NodeJS誕生與蓬勃發展中變得更加被人們重視。很多朋友學NodeJS,學很久一直摸不著門道,覺得最后在用Express寫Web程序,有這樣的感覺只能說明沒有學懂NodeJS,本質上說不理解回調,就不理解NodeJS。
NodeJS有三大核心:
- CallBack回調
- Event事件
- Stream流

TA貢獻1900條經驗 獲得超5個贊
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script src="./react-0.13.2/build/react.js"></script>
<script src="./react-0.13.2/build/JSXTransformer.js"></script>
<script type="text/jsx">
var style = {
color : "red",
border: "1px #000 solid",
};
var HelloWorld = React.createClass({
getDefaultProps: function(){console.log("getDefaultProps1");},
getInitialState: function(){console.log("getInitialState2");return null;},
componentWillMount:function(){console.log("componentWillMount3")},
render: function(){
console.log("render4");
return <p>初始化階段的函數執行狀態</p>
},
componentDidMount:function(){console.log("componentDidMount5")}
});
React.render(<div style={style}><HelloWorld></HelloWorld></div>, document.body);
</script>
</body>
- 2 回答
- 0 關注
- 1621 瀏覽
添加回答
舉報