几天后,当 content changes.But无法解决问题时,我很难让trix编辑的 tirx-change事件触发,我正在使用react进行查看。下面是我的代码:
class Desc extends React.Component {
handleChangeTrix(event){this.setState({[event.target.description.name]:
event.target.description.value});
}
render(){
return(
<div className="container-fluid">
<form onSubmit = {this.handleSubmit.bind(this)}
className="form-horizontal" >
<input id="description"
name="description"
className="form-control"
value={this.state.description}
hidden="True" type="hidden">
</input>
<trix-editor trix-change={this.handleChangeTrix.bind(this)}
classname="trix-content"
input="description"
placeholder="Start typing here...." >
</trix-editor>
<button type="submit">submit</button>
</form>
</div>);
}
}如果你觉得遗漏了一些细节,请在comment.If上问,你觉得问题是不合适的,值得投反对票,我很想通过你的宝贵评论来了解错误。提前谢谢。
发布于 2016-07-07 07:01:25
你说setState错了。它应该改为
handleChangeTrix(event){this.setState({description:
event.target.description.value});https://stackoverflow.com/questions/38238866
复制相似问题