diff options
author | Maksim Zakharov <m.zakharov@IBS.RU> | 2022-08-03 17:28:55 +0300 |
---|---|---|
committer | Maksim Zakharov <m.zakharov@IBS.RU> | 2022-08-03 17:28:55 +0300 |
commit | 056f1371ef17398ac61dbf52b1840db0c73caf8f (patch) | |
tree | c72db9e5f75761cf2effa01f293d5e70962467a2 /src/components/_sila | |
parent | 3bce3e1f788debaf7e964655c9727a179fa78e1d (diff) | |
parent | 7fc5f1a8f2d72c3775ae873a8768b96bfb66db73 (diff) | |
download | webui-vue-056f1371ef17398ac61dbf52b1840db0c73caf8f.tar.xz |
Merge branch 'sila-ui' into sila
Diffstat (limited to 'src/components/_sila')
-rw-r--r-- | src/components/_sila/Mixins/VuelidateMixin.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/components/_sila/Mixins/VuelidateMixin.js b/src/components/_sila/Mixins/VuelidateMixin.js index fec85251..343d24a7 100644 --- a/src/components/_sila/Mixins/VuelidateMixin.js +++ b/src/components/_sila/Mixins/VuelidateMixin.js @@ -4,6 +4,15 @@ const VuelidateMixin = { const { $dirty, $error } = model; return $dirty ? !$error : null; }, + getIpValidationState(model) { + const { $dirty, $error, $model } = model; + return $dirty + ? !$error && + /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test( + $model + ) + : null; + }, }, }; |