【发布时间】:2016-11-13 00:41:22
【问题描述】:
我正在创建一个带有 textarea 和 Remarkable 的降价编辑器。我只想在文本长度大于最小值时提交。如何获取输出中显示的文本的实际长度
var CharCounter = React.createClass({
getText : function(){
if(this.props.count < this.props.min)
return (this.props.min - this.props.count) + ' more to go';
else if(this.props.count < this.props.max)
return (this.props.max - this.props.count) + ' left';
else
return 'Done';
},
render : function(){
return(
<p><small>{this.getText()}</small></p>
);
}
});
问题是,如果我尝试直接使用文本区域值。长度包括markdown .ie ['*', '**']
【问题讨论】:
标签: javascript html reactjs markdown