/
githubmirror
/
vuetify
Обзор
Документация
Войти
/
githubmirror
/
vuetify
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
packages/docs/src/examples/v-form/usage.vue
80 строк
2 KB
TeeBeeCoder
docs(VForm): correct typo in validation message in example (#20627)
28 окт 2024, 20:41
Не верифицирован
28 окт 2024, 20:41
cfaf744
Код
Авторство
О чём код?
<template> <v-form v-model="valid"> <v-container> <v-row> <v-col cols="12" md="4" > <v-text-field v-model="firstname" :counter="10" :rules="nameRules" label="First name" required ></v-text-field> </v-col> <v-col cols="12" md="4" > <v-text-field v-model="lastname" :counter="10" :rules="nameRules" label="Last name" required ></v-text-field> </v-col> <v-col cols="12" md="4" > <v-text-field v-model="email" :rules="emailRules" label="E-mail" required ></v-text-field> </v-col> </v-row> </v-container> </v-form> </template> <script> export default { data: () => ({ valid: false, firstname: '', lastname: '', nameRules: [ value => { if (value) return true return 'Name is required.' }, value => { if (value?.length <= 10) return true return 'Name must be less than 10 characters.' }, ], email: '', emailRules: [ value => { if (value) return true return 'E-mail is required.' }, value => { if (/.+@.+\..+/.test(value)) return true return 'E-mail must be valid.' }, ], }), } </script>