Skip to main content

readonly

readonly: boolean

this property controls whether the editor is in read-only mode. The default property value is false.

Usage

Initializing editor in readonly mode

<script>
import { Editor } from "wx-svelte-editor";

const items = [
{ comp: "text", key: "name", label: "Name" },
{
comp: "textarea",
key: "descr",
label: "Description",
},
{ comp: "checkbox", key: "admin", label: "Is Admin" }
];
const values = {
name: "John Doe",
descr: "Lorem ipsum dolor sit amet",
admin: true,
role: "admin"
};
</script>

<Editor {items} {values} readonly={true} />

This example shows how to initialize the editor in read-only mode by setting the readonly property to true.