From 0266c0c07b2f06d80996c9cce687a0955ebfffe8 Mon Sep 17 00:00:00 2001 From: Dhaverd Date: Sun, 27 Oct 2024 14:05:23 +0800 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B5=D0=BC=D0=BD=D0=BE=D0=B3=D0=BE=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=BA=D0=B0=D1=87=D0=B0=D0=BB=20=D1=84=D0=BE?= =?UTF-8?q?=D1=80=D0=BC=D1=8B=20=D0=92=D1=85=D0=BE=D0=B4=D0=B0=20=D0=B8=20?= =?UTF-8?q?=D0=A0=D0=B5=D0=B3=D0=B8=D1=81=D1=82=D1=80=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/js/rules.js | 9 +++++++++ resources/views/Auth/Login.vue | 18 ++++++++++++++++-- resources/views/Auth/Registration.vue | 27 ++++++++++++++++++++++++--- resources/views/Welcome.vue | 1 + 4 files changed, 50 insertions(+), 5 deletions(-) create mode 100644 resources/js/rules.js diff --git a/resources/js/rules.js b/resources/js/rules.js new file mode 100644 index 0000000..f91263d --- /dev/null +++ b/resources/js/rules.js @@ -0,0 +1,9 @@ +export const rules = { + email: value => { + const pattern = /^[A-Za-z0-9\._]+@{1}[A-Za-z0-9]+\.[a-z]+$/ + return pattern.test(value) || 'Неверный email' + }, + notNull: value => { + return (value !== null && value !== undefined && value !== '') || 'Поле не может быть пустым'; + } +} diff --git a/resources/views/Auth/Login.vue b/resources/views/Auth/Login.vue index 89e6162..3a60f92 100644 --- a/resources/views/Auth/Login.vue +++ b/resources/views/Auth/Login.vue @@ -1,8 +1,14 @@