Check if json is valid
Opened this issue · 1 comments
joweste commented
Hi,
How could I check for errors before submit the edited json?
Psedo-code:
if (json is valid){
submit form with json
}
yansenlei commented
You can use $refs
get data and check for errors.
<v-jsoneditor ref="editor" v-model="data" :options="options"></v-jsoneditor>
try {
let data = this.$refs.editor.editor.get();
console.log(data);
} catch (error) {
console.log("get error:", error);
}