working on document editor

This commit is contained in:
2025-07-10 23:37:29 +02:00
parent 32e2d91ee6
commit 85b5ca1970
5 changed files with 92 additions and 10 deletions

View 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>