我使用 defaultValue 在 textarea 中传递 this.props.childred 但它给了我错误未捕获错误:如果您defaultValue在 a 上提供,请勿传递子项。
还有什么其他选择或者有更好的方法来确定价值观
import React, {Component} from 'react';
class Update extends Component {
constructor(props){
super(props);
this.state = {
editing:false
}
this.renderEdit = this.renderEdit.bind(this)
}
edit(){
this.setState({
editing:true
})
}
remove(){
alert("remove")
}
save(){
this.setState({
editing:false
})
}
renderNormal(){
return (
<div className="container">
<div className="content"> {this.props.children}</div>
<button onClick={this.edit.bind(this)} className="edit" >Edit </button>
<button onClick={this.remove} className="remove" >Remove </button>
</div>
);
}
renderEdit(){
console.log( 'this.props ', this.props)
console.log( 'this.props.children ', this.props.children)
return (
<div className="container"> …Run Code Online (Sandbox Code Playgroud) 我需要查看Angular Material的默认图标列表 https://material.angular.io/components/icon/overview
我没有使用Font Awesome和Google Fonts