svelte-quill
svelte-quill copied to clipboard
No way to retrieve quill instance to make native API calls on it?
I'm new to svelte so maybe I'm missing something, but as far as I can tell, with the svelte implementation being inline within the HTML, there's no way to retrieve the quill instance. Is that correct?
In case somebody has the same issue.
Example in Github readme didn't work for me, I noticed you can get the html element and access hidden __quill
property or use Quill directly - which is way nicer.
So I did that:
<script lang="ts">
import Quill from 'quill/core';
let quillElement;
onMount(() => {
const editorInstance = Quill.find(quillElement);
editorInstance?.setText(initialText);
});
</script>
<div class="wysiwyg-container">
<div bind:this={quillElement}
use:quill={options}
on:text-change></div>
</div>
</style>