File tree Expand file tree Collapse file tree 1 file changed +32
-29
lines changed Expand file tree Collapse file tree 1 file changed +32
-29
lines changed Original file line number Diff line number Diff line change @@ -8,12 +8,15 @@ This package allow to display errors from laravel validation rules
8
8
9
9
# Installation
10
10
11
- ``` npm install --save laravel-vue-validator
11
+ ```
12
+ npm install --save laravel-vue-validator
13
+ ```
12
14
13
- import LaravelVueValidator from 'laravel-vue-validator'
15
+ ``` javascript
16
+ import LaravelVueValidator from ' laravel-vue-validator'
14
17
15
- Vue.use(LaravelVueValidator)
16
- ```
18
+ Vue .use (LaravelVueValidator)
19
+ ```
17
20
18
21
# Usage Example
19
22
@@ -33,32 +36,32 @@ To flush errors in a vue component:
33
36
34
37
# Full Example
35
38
36
- ```
37
- <template>
38
- <input type='text' v-model='name' />
39
- <!--
40
- error do not need v-if,
41
- its content is displayed only if "name" has error after validation"
42
- -->
43
- <error input="name" />
44
- <button @click="submit">Submit</button>
45
- </template>
46
- <script>
47
-
48
- export default {
49
-
50
- data(){
51
- return{
52
- name: ''
53
- }
54
- },
55
-
56
- methods(){
57
- // Error are displayed if Laravel backend return 422 Http code with name as error
58
- this.$http.post('/submit', {name: this.name});
39
+ ``` html
40
+ <template >
41
+ <input type =' text' v-model =' name' />
42
+ <!--
43
+ error do not need v-if,
44
+ its content is displayed only if "name" has error after validation"
45
+ -->
46
+ <error input =" name" />
47
+ <button @click =" submit" >Submit</button >
48
+ </template >
49
+ <script >
50
+
51
+ export default {
52
+
53
+ data (){
54
+ return {
55
+ name: ' '
59
56
}
57
+ },
60
58
59
+ methods (){
60
+ // Error are displayed if Laravel backend return 422 Http code with name as error
61
+ this .$http .post (' /submit' , {name: this .name });
61
62
}
62
63
63
- </script>
64
- ```
64
+ }
65
+
66
+ </script >
67
+ ```
You can’t perform that action at this time.
0 commit comments