使用keyof关键字
get(key :keyof State): void {
const t = this.state[key];
this.setState<any>({
[key]: !t
})
}
textInput(e: React.FormEvent<HTMLInputElement>, key:string): void {
this.setState({
[key]: e.currentTarget.value
});
}