json-schema-enhanced-editor-vue
v0.2.0
Published
A lightweight vue json editor based on codemirror, providing smart prompts and verification based on json-schema
Downloads
10
Maintainers
Readme
JSON-Schema-Enhanced-Editor-Vue
json-schema-enhanced-editor-vue is a lightweight json editor based on vue & codemirror, providing smart prompts and verification based on json-schema.
Usage
<template>
<Editor
v-model="value"
:schema="schema"
:height="height"
:change="onChange"
/>
</template>
<script setup lang="ts">
import { JSONSchema7 } from "json-schema";
import { Editor } from "json-schema-enhanced-editor-vue";
const value: Ref<string> = ref(JSON.stringify({ ...mock.package }, null, 4));
const schema: Ref<JSONSchema7 | null> = ref(null);
const height: Ref<string> = ref("300px");
const onChange = (value: string) => {
console.log('value: ', value);
}
</script>