feat: make default value display correctly
This commit is contained in:
18
README.md
18
README.md
@@ -1,14 +1,5 @@
|
||||
# svelte-editor-quill
|
||||
|
||||
[![NPM version][npm-img]][npm]
|
||||
<!-- [![Build Status][ci-img]][ci] -->
|
||||
|
||||
|
||||
[npm-img]: https://img.shields.io/npm/v/@tadashi/svelte-editor-quill.svg
|
||||
[npm]: https://www.npmjs.com/package/@tadashi/svelte-editor-quill
|
||||
<!-- [ci-img]: https://github.com/lagden/svelte-editor-quill/workflows/Node.js%20CI/badge.svg -->
|
||||
<!-- [ci]: https://github.com/lagden/svelte-editor-quill/actions?query=workflow%3A%22Node.js+CI%22 -->
|
||||
|
||||
---
|
||||
|
||||
Svelte component
|
||||
@@ -17,7 +8,7 @@ Svelte component
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm i @tadashi/svelte-editor-quill
|
||||
$ npm i @resultium/svelte-editor-quill
|
||||
```
|
||||
|
||||
|
||||
@@ -45,7 +36,7 @@ Accept only paste plain text.
|
||||
|
||||
```html
|
||||
<script>
|
||||
import {Editor} from '@tadashi/svelte-editor-quill'
|
||||
import {Editor} from '@resultium/svelte-editor-quill'
|
||||
|
||||
const options = {
|
||||
theme: 'snow',
|
||||
@@ -58,14 +49,15 @@ Accept only paste plain text.
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<link rel="preconnect" href="https://cdn.quilljs.com" crossorigin>
|
||||
<link rel="preconnect" href="https://cdn.quilljs.com">
|
||||
<link rel="stylesheet" href="https://cdn.quilljs.com/1.3.7/quill.snow.css">
|
||||
</svelte:head>
|
||||
|
||||
<Editor {options} on:text-change={onTextChange} data='Apenas um show' />
|
||||
<Editor {options} on:text-change={onTextChange} data='Lorem ipsum dolor' />
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Thiago Lagden](https://github.com/lagden)
|
||||
MIT © Resultium LLC
|
||||
|
||||
12
package.json
12
package.json
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "@tadashi/svelte-editor-quill",
|
||||
"version": "2.2.0",
|
||||
"description": "Svelte component",
|
||||
"author": "Thiago Lagden",
|
||||
"name": "@resultium/svelte-editor-quill",
|
||||
"version": "1.0.0",
|
||||
"description": "Quill.js implementation in svelte",
|
||||
"author": "Resultium LLC",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/lagden/svelte-editor-quill/issues"
|
||||
"email": "technology@resultium.io"
|
||||
},
|
||||
"homepage": "https://github.com/lagden/svelte-editor-quill#readme",
|
||||
"homepage": "https://git.resultium.net/public/svelte-editor-quill",
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
},
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
onMount(async () => {
|
||||
const {quill} = await import('./quill.js')
|
||||
destroy = quill(node, options)
|
||||
|
||||
node.firstChild.innerHTML = data
|
||||
})
|
||||
|
||||
onDestroy(() => {
|
||||
@@ -26,5 +28,5 @@
|
||||
</script>
|
||||
|
||||
<div class={className}>
|
||||
<div bind:this={node} on:text-change>{@html data}</div>
|
||||
<div bind:this={node} on:text-change />
|
||||
</div>
|
||||
|
||||
@@ -36,7 +36,6 @@ export function quill(node, options) {
|
||||
modules: {
|
||||
toolbar,
|
||||
},
|
||||
placeholder: 'Digite algo...',
|
||||
...options,
|
||||
})
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<link rel="preconnect" href="https://cdn.quilljs.com" crossorigin />
|
||||
<link rel="stylesheet" href="https://cdn.quilljs.com/1.3.7/quill.snow.css" crossorigin />
|
||||
<link rel="preconnect" href="https://cdn.quilljs.com" />
|
||||
<link rel="stylesheet" href="https://cdn.quilljs.com/1.3.7/quill.snow.css" />
|
||||
</svelte:head>
|
||||
|
||||
<Editor {options} on:text-change={onTextChange} data="Apenas um show" />
|
||||
<Editor {options} on:text-change={onTextChange} data="<p>test</p><p>sample</p>" />
|
||||
|
||||
Reference in New Issue
Block a user