|
3 | 3 | <h1>Custom label, help, hint and errors (with grouping)</h1>
|
4 | 4 | <div class="row">
|
5 | 5 | <div class="col-sm-12">
|
6 |
| - <vue-form-generator :schema="schema" :model="model" :options="formOptions" tag="section"> |
| 6 | + <vue-form-generator :schema="schema" |
| 7 | + :model="model" |
| 8 | + :options="formOptions" |
| 9 | + tag="section"> |
7 | 10 |
|
8 |
| - <template slot="label" slot-scope="{ field, getValueFromOption }"> |
| 11 | + <template slot="label" |
| 12 | + slot-scope="{ field, getValueFromOption }"> |
9 | 13 | <h3><i :class="`fa fa-${getIcon(field, getValueFromOption)}`"></i> {{ field.label }}</h3>
|
10 | 14 | </template>
|
11 | 15 |
|
12 |
| - <template slot="help" slot-scope="{ field }"> |
13 |
| - <span v-if='field.help' class="help"> |
| 16 | + <template slot="help" |
| 17 | + slot-scope="{ field }"> |
| 18 | + <span v-if='field.help' |
| 19 | + class="help"> |
14 | 20 | <span @click.prevent="testClick(field.help, $event)">Need help</span>
|
15 | 21 | <i class="fa fa-question"></i>
|
16 |
| - <vue-markdown class="helpText" :source="field.help"></vue-markdown> |
| 22 | + <vue-markdown class="helpText" |
| 23 | + :source="field.help"></vue-markdown> |
17 | 24 | </span>
|
18 | 25 | </template>
|
19 | 26 |
|
20 |
| - <template slot="hint" slot-scope="{ field, getValueFromOption }"> |
| 27 | + <template slot="hint" |
| 28 | + slot-scope="{ field, getValueFromOption }"> |
21 | 29 | <div class="hint hint--info">
|
22 | 30 | <i class="fa fa-info-circle"></i>
|
23 | 31 | <span v-html="getValueFromOption(field, 'hint', undefined)"></span>
|
24 | 32 | </div>
|
25 | 33 | </template>
|
26 | 34 |
|
27 |
| - <template slot="errors" slot-scope="{ errors, field, getValueFromOption }"> |
| 35 | + <template slot="errors" |
| 36 | + slot-scope="{ errors, field, getValueFromOption }"> |
28 | 37 | <span>Custom errors</span>
|
29 | 38 | <table class="errors help-block">
|
30 | 39 | <tbody>
|
31 | 40 | <thead>
|
32 | 41 | <tr>
|
33 |
| - <th scope="col" id="">Index</th> |
34 |
| - <th scope="col" id="">Error</th> |
| 42 | + <th scope="col">Index</th> |
| 43 | + <th scope="col">Error</th> |
35 | 44 | </tr>
|
36 | 45 | </thead>
|
37 | 46 | <tbody>
|
38 |
| - <tr v-for="(error, index) in errors" :key="index"> |
39 |
| - <td>{{index}}</td> |
| 47 | + <tr v-for="(error, index) in errors" |
| 48 | + :key="index"> |
| 49 | + <td>{{ index }}</td> |
40 | 50 | <td v-html="error"></td>
|
41 | 51 | </tr>
|
42 | 52 | </tbody>
|
|
0 commit comments