Svelte component
$ npm i @tadashi/svelte-editor-quill
Example via StackBlitz.
Type: object
Default: {theme: 'snow'}
See the more options
here.
Type: boolean
Default: false
Accept only paste plain text.
<script>
import {Editor} from '@tadashi/svelte-editor-quill'
const options = {
theme: 'snow',
}
let data = 'Apenas <b>um</b> show'
let text = ''
let html = ''
const onTextChange = event => {
;({text, html} = event?.detail ?? {})
data = html
}
</script>
<svelte:head>
<link
rel="stylesheet"
href="https://unpkg.com/[email protected]/dist/quill.snow.css"
crossorigin
/>
</svelte:head>
<Editor
{options}
{data}
on:text-change="{onTextChange}"
/>
<div>
<h3>Text</h3>
<pre>{text}</pre>
</div>
<div>
<h3>HTML</h3>
<pre>{@html html}</pre>
</div>
<div>
<h3>Data</h3>
<pre>{@html data}</pre>
</div>
BTC: bc1q7famhuj5f25n6qvlm3sssnymk2qpxrfwpyq7g4
MIT © Thiago Lagden