working on document editor
This commit is contained in:
20
frontend/src/Components/MarkdownEditor.svelte
Normal file
20
frontend/src/Components/MarkdownEditor.svelte
Normal file
@@ -0,0 +1,20 @@
|
||||
<script>
|
||||
let { editable = false, value = $bindable(null) } = $props();
|
||||
let editing = $state(false);
|
||||
|
||||
function toggleEdit(){
|
||||
editing = !editing;
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
textarea{
|
||||
width: 100%;
|
||||
min-height: 100px;
|
||||
}
|
||||
</style>
|
||||
|
||||
{#if editable && editing}
|
||||
<textarea bind:value></textarea>
|
||||
{/if}
|
||||
<div onclick={toggleEdit}>{@html value}</div>
|
||||
Reference in New Issue
Block a user