jsdoc de una sola cosa

pull/2/head
Borja Robert 2 years ago
parent 94b24195bb
commit 9429ffb57c

@ -1,9 +1,8 @@
<script> <script>
import { onMount } from 'svelte'; import { onMount } from 'svelte';
import { title, heading, subtitle, content, date, address } from '$lib/stores/store'; import { title, heading, subtitle, content, date, address } from '$lib/stores/store';
let editor; /** @type {HTMLDivElement} */ let editor;
let innerHTML; let innerHTML;
const handleSubmit = async () => { const handleSubmit = async () => {
@ -12,23 +11,21 @@
const getContent = () => { const getContent = () => {
if (!editor) { if (!editor) {
console.log("no hay editor"); console.log('no hay editor');
return return;
};
$content = editor.firstChild.innerHTML;
} }
$content = editor.firstChild.innerHTML;
};
const quillOptions = { const quillOptions = {
modules: { modules: {
toolbar: [ toolbar: [['bold', 'italic']]
['bold', 'italic'],
]
}, },
theme: 'snow' theme: 'snow'
}; };
onMount(async () => { onMount(async () => {
const {default: Quill } = await import("quill"); const { default: Quill } = await import('quill');
let quill = new Quill(editor, { let quill = new Quill(editor, {
modules: { modules: {
@ -38,7 +35,6 @@
placeholder: 'contenido' placeholder: 'contenido'
}); });
}); });
</script> </script>
<form on:submit|preventDefault={handleSubmit}> <form on:submit|preventDefault={handleSubmit}>
@ -59,7 +55,8 @@
<div class="form-group"> <div class="form-group">
<label for="content">Contenido</label> <label for="content">Contenido</label>
<div id="editor" on:click={getContent}><div on:click={getContent} on:keyup={getContent} bind:this={editor} ></div> <div id="editor" on:click={getContent}>
<div on:click={getContent} on:keyup={getContent} bind:this={editor} />
</div> </div>
<div class="form-group"> <div class="form-group">
@ -71,6 +68,7 @@
<label for="address">Dirección</label> <label for="address">Dirección</label>
<input bind:value={$address} type="text" name="address" /> <input bind:value={$address} type="text" name="address" />
</div> </div>
</div>
</form> </form>
<style> <style>

Loading…
Cancel
Save