From 13390b59c408b770dc28ba71972dfae31a4ff90d Mon Sep 17 00:00:00 2001 From: Zaytsev Kirill Date: Tue, 10 Nov 2020 10:24:31 +0300 Subject: [PATCH] docs: Fixed README.md --- README.md | 130 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 67 insertions(+), 63 deletions(-) diff --git a/README.md b/README.md index ea4f6b3..ba3625c 100644 --- a/README.md +++ b/README.md @@ -1,86 +1,90 @@ ## What is Vue Formulario? -Vue Formulario is a library, based on Vue Formulate, that handles the core logic for working with forms and gives full control on the form presentation. +Vue Formulario is a library, based on Vue Formulate, that handles the core logic +for working with forms and gives full control on the form presentation. ## Examples -Every form control have to rendered inside FormularioInput component. This component provides `id` and `context` in v-slot props. Control should use `context.model` as v-model and `context.blurHandler` as handler for `blur` event (it is necessary for validation when property `errorBehavior` is `blur`). Errors object list for field can be accessed through `context.allErrors`. Each error is an object with fields message (translated message), rule (rule name) and context. +Every form control have to rendered inside FormularioInput component. This component provides `id` and `context` in +v-slot props. Control should use `context.model` as v-model and `context.runValidation` as handler for `blur` event +(it is necessary for validation when property `validationBehavior` is `demand`). Errors list for a field can be +accessed through `context.allErrors`. The example below creates the authorization form from data: ```json - { - "username": "", - "password": "", - "options": { - "anonym": false, - "tags": ["test"] - }, +{ + "username": "", + "password": "", + "options": { + "anonymous": false, + "tags": ["test"] } +} ``` ```html - + - - + -
- +
+
+ + + + + + + +
+ - {{ error.message }} - +
+
- + - - - - - -
- - -
-
-
- - - - -
+ + ``` ## License