📜  用表单反应函数 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:42.999000             🧑  作者: Mango

代码示例1
import React, {useState} from 'react';

function Submit() {

    const [inputField , setInputField] = useState({
        first_name: '',
        last_name: '',
        gmail: ''
    })

    const inputsHandler = (e) =>{
        setInputField( {[e.target.name]: e.target.value} )
    }

    const submitButton = () =>{
        alert(inputField.first_name)
    }

    return (
        



) } export default Submit