File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed
src/components/QuestionTypes Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change 66 */
77
88 import TextType from ' ./TextType.vue'
9- import LanguageModel from ' ../../models/LanguageModel'
109 import { QuestionType } from ' ../../models/QuestionModel'
1110
1211 export default {
2322 methods: {
2423 validate () {
2524 if (this .hasValue ) {
25+ if (this .question .mask ) {
26+ return this .validateMask ()
27+ }
28+
2629 return ! isNaN (+ this .dataValue )
2730 }
2831
Original file line number Diff line number Diff line change 6767 methods: {
6868 validate () {
6969 if (this .question .mask && this .hasValue ) {
70- if (Array .isArray (this .question .mask )) {
71- return this .question .mask .some (mask => mask .length === this .dataValue .length )
72- }
73-
74- return this .dataValue .length === this .question .mask .length
70+ return this .validateMask ()
7571 }
7672
7773 return ! this .question .required || this .hasValue
74+ },
75+
76+ validateMask () {
77+ if (Array .isArray (this .question .mask )) {
78+ return this .question .mask .some (mask => mask .length === this .dataValue .length )
79+ }
80+
81+ return this .dataValue .length === this .question .mask .length
7882 }
7983 }
8084 }
You can’t perform that action at this time.
0 commit comments