React全棧 社交網路程式 提交表單資料

2022-06-16 14:57:14 字數 1268 閱讀 3925

1. 給每個input **新增change 事件

當input  變化時觸發

onchange事件:

//獲取輸入的值,每個值對應相對應的名字 

onchange(e) );

}

e.target.value :表示input  輸入的內容   e.target.name:表示輸入框對應的名字

2.新增**提交事件

onsubmit 事件:

onsubmit(e) ;

console.log(newuser)

//

// email: "[email protected]"

// name: "zxw"

// password: "123"

// password2: "123"

// __proto__: object

// }

}

記得繫結this 的指向:

constructor() 

};this.onchange = this.onchange.bind(this);

this.onsubmit = this.onsubmit.bind(this);

}

完整**

import react,  from 'react'

class register extends component

};this.onchange = this.onchange.bind(this);

this.onsubmit = this.onsubmit.bind(this);

} //獲取輸入的值,每個值對應相對應的名字

phpFox社交程式 v2 1 0 網路社交程式

phpfox是一套很有特色的網路社交程式,她能提供給我們功能強大的社交解決方案。我們的目標是 通過phpfox讓您擁有類似人人喜歡的facebook和myspace社交 而且她的管理平台讓您全權管理您 上的所有功能!無加密 加入phpfox後你就會發現你擁有了乙個很廣的社交網,幾萬個使用phpfox...

工程級React註冊登入全棧級流程

建立好專案之後,刪掉 src 目錄下的檔案,按照以下結構建立目錄,根據具體專案情況進行更改 npm install antd sant design 是深受人喜愛的企業級 ui 設計語言和 react 元件庫 npm install react router dom s使用路由進行不同頁面間的切換 ...

Python全棧 Day8 網路配置

ifconfig 檢視所有啟用的網絡卡資訊 ifconfig 網絡卡名稱 n 虛擬一塊網絡卡,n為數字表示第幾塊 ifconfig 網絡卡名稱 down ifdown 網絡卡名稱 停用網絡卡 ifconfig 網絡卡名稱 up ifup 網絡卡名稱 啟用網絡卡 etc sysconfig netwo...