forked from yourtion/vue-json-ui-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
761 additions
and
715 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,67 @@ | ||
# vue-json-ui-editor | ||
# json-editor | ||
|
||
> Edit JSON in UI form with JSON Schema and Vue.js | ||
Edit JSON in UI form with JSON Schema and Vue.js `<json-editor>` component. | ||
|
||
## Build Setup | ||
## props | ||
|
||
``` bash | ||
# install dependencies | ||
npm install | ||
- `schema` ***Object*** (*required*) | ||
The JSON Schema object. Use the `v-if` directive to load asynchronous schema. | ||
|
||
# serve with hot reload at localhost:8080 | ||
npm run dev | ||
- `v-model` ***Object*** (*optional*) `default: [object Object]` | ||
Use this directive to create two-way data bindings with the component. It automatically picks the correct way to update the element based on the input type. | ||
|
||
# build for production with minification | ||
npm run build | ||
- `auto-complete` ***String*** (*optional*) | ||
This property indicates whether the value of the control can be automatically completed by the browser. Possible values are: `off` and `on`. | ||
|
||
# build for production and view the bundle analyzer report | ||
npm run build --report | ||
``` | ||
- `no-validate` ***Boolean*** (*optional*) | ||
This Boolean attribute indicates that the form is not to be validated when submitted. | ||
|
||
For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader). | ||
- `input-wrapping-class` ***String*** (*optional*) | ||
Define the inputs wrapping class. Leave `undefined` to disable input wrapping. | ||
|
||
## data | ||
|
||
- `default` | ||
*initial value:* `[object Object]` | ||
|
||
- `fields` | ||
*initial value:* `[object Object]` | ||
|
||
- `error` | ||
*initial value:* `null` | ||
|
||
- `data` | ||
*initial value:* `[object Object]` | ||
|
||
## events | ||
|
||
- `input` Fired synchronously when the value of an element is changed. | ||
|
||
- `change` Fired when a change to the element's value is committed by the user. | ||
|
||
- `invalid` Fired when a submittable element has been checked and doesn't satisfy its constraints. The validity of submittable elements is checked before submitting their owner form, or after the `checkValidity()` of the element or its owner form is called. | ||
|
||
- `submit` Fired when a form is submitted | ||
|
||
## methods | ||
|
||
- `input(name)` | ||
Get a form input reference | ||
|
||
- `form()` | ||
Get the form reference | ||
|
||
- `checkValidity()` | ||
Checks whether the form has any constraints and whether it satisfies them. If the form fails its constraints, the browser fires a cancelable `invalid` event at the element, and then returns false. | ||
|
||
- `reset()` | ||
Reset the value of all elements of the parent form. | ||
|
||
- `submit(event)` | ||
Send the content of the form to the server | ||
|
||
- `setErrorMessage(message)` | ||
Set a message error. | ||
|
||
- `clearErrorMessage()` | ||
clear the message error. |
Oops, something went wrong.