Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
lib
react-ag-qeditor
Commits
6fed9ce9
Commit
6fed9ce9
authored
May 10, 2022
by
Рамис
Browse files
add onChange func
parent
d79674e6
Changes
2
Show whitespace changes
Inline
Side-by-side
example/src/App.js
View file @
6fed9ce9
...
...
@@ -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
>
}
...
...
src/QEditor.jsx
View file @
6fed9ce9
...
...
@@ -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
'
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment