Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if json is valid #29

Open
joweste opened this issue Sep 30, 2020 · 1 comment
Open

Check if json is valid #29

joweste opened this issue Sep 30, 2020 · 1 comment

Comments

@joweste
Copy link

joweste commented Sep 30, 2020

Hi,
How could I check for errors before submit the edited json?
Psedo-code:
if (json is valid){
submit form with json
}

@yansenlei
Copy link
Owner

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);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants