Skip to content

Commit

Permalink
feat: slugify label in ValidationProvider name
Browse files Browse the repository at this point in the history
  • Loading branch information
14nrv committed Oct 24, 2020
1 parent 089b63f commit fe326f3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/Fields/Control.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
tag="div"
:vid="item.vid"
:rules="getRules"
:name="item.name || item.label"
:name="item.name || item.label | slugify"
:immediate="!!item.value"
v-slot="{ errors, required, ariaInput }")

Expand All @@ -22,6 +22,7 @@
</template>

<script>
import { slug } from '@/helpers'
import Input from '@/components/Fields/Input'
import Select from '@/components/Fields/Select'
import Textarea from '@/components/Fields/Textarea'
Expand All @@ -32,6 +33,9 @@ const NOT_NORMAL_INPUT = ['textarea', 'select', 'checkbox', 'radio']
export default {
name: 'Control',
filters: {
slugify: value => slug(value)
},
components: {
appInput: Input,
appSelect: Select,
Expand Down

0 comments on commit fe326f3

Please sign in to comment.