File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
packages/vue-quill/src/components Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -265,7 +265,7 @@ export const QuillEditor = defineComponent({
265265
266266 const setContents = ( content : string | Delta , source : Sources = 'api' ) => {
267267 if ( props . contentType === 'html' ) {
268- setHTML ( content as string , source )
268+ setHTML ( content as string )
269269 } else if ( props . contentType === 'text' ) {
270270 setText ( content as string , source )
271271 } else {
@@ -285,7 +285,11 @@ export const QuillEditor = defineComponent({
285285 return quill ?. root . innerHTML ?? ''
286286 }
287287
288- const setHTML = ( html : string , source : Sources = 'api' ) => {
288+ const setHTML = ( html : string ) => {
289+ if ( quill ) quill . root . innerHTML = html
290+ }
291+
292+ const pasteHTML = ( html : string , source : Sources = 'api' ) => {
289293 const delta = quill ?. clipboard . convert ( html as { } )
290294 if ( delta ) quill ?. setContents ( delta , source )
291295 }
@@ -322,6 +326,7 @@ export const QuillEditor = defineComponent({
322326 setContents,
323327 getHTML,
324328 setHTML,
329+ pasteHTML,
325330 getText,
326331 setText,
327332 reinit,
You can’t perform that action at this time.
0 commit comments