Commit 6fed9ce9 by Рамис

add onChange func

parent d79674e6
......@@ -6,7 +6,9 @@ import 'react-ag-qeditor/dist/index.css'
const App = () => {
return <div style={{padding:40}}>
<QEditor />
<QEditor value={'<p>asds</p>'} onChange={(value)=>{
console.log('sads', value);
}} />
</div>
}
......
......@@ -187,7 +187,7 @@ export default class QEditor extends React.Component {
window.katex = katex;
if ( ! this.state.init) {
if ( !this.state.init) {
return null;
}
return (
......@@ -198,7 +198,9 @@ export default class QEditor extends React.Component {
ref={ref => this.quillRef = ref}
defaultValue={value}
theme="snow"
onChange={(value) => {console.log(value)}}
onChange={value => {
this.props.onChange(value)
}}
modules={this.modules}
formats={this.formats}
onChangeSelection={(range, source, editor) => {
......@@ -240,5 +242,7 @@ export default class QEditor extends React.Component {
QEditor.defaultProps = {
maxWidth: 'auto',
maxHeight: 1000
maxHeight: 1000,
onChange: ()=>{},
lang: 'ru'
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment