Added Editing of Questions
This commit is contained in:
@@ -1,24 +1,36 @@
|
||||
<script lang="ts">
|
||||
import type { HTMLInputTypeAttribute } from "svelte/elements";
|
||||
|
||||
interface Props {
|
||||
value: string;
|
||||
value: any;
|
||||
label?: string;
|
||||
type?: HTMLInputTypeAttribute;
|
||||
readonly?: boolean;
|
||||
class?: string;
|
||||
}
|
||||
|
||||
let { value = $bindable(), label }: Props = $props();
|
||||
let {
|
||||
value = $bindable(),
|
||||
label,
|
||||
type = "text",
|
||||
readonly = false,
|
||||
class: className
|
||||
}: Props = $props();
|
||||
|
||||
const id = crypto.randomUUID();
|
||||
</script>
|
||||
|
||||
<div>
|
||||
<div class="w-full grow">
|
||||
{#if label}
|
||||
<label for="textfield-{id}" class="">{label}</label>
|
||||
{/if}
|
||||
<div>
|
||||
<input
|
||||
type="text"
|
||||
{type}
|
||||
{readonly}
|
||||
name="textfield"
|
||||
id="textfield-{id}"
|
||||
class="borders mt-2 mb-2 w-full"
|
||||
class="borders mt-2 mb-2 w-full {className}"
|
||||
bind:value
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user