You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
378 B
20 lines
378 B
<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>
|
|
|