quasar
Version:
Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time
72 lines (64 loc) • 2.34 kB
JSON
{
"props": {
"error": {
"type": "Boolean",
"desc": "Does field have validation errors?",
"category": "behavior"
},
"error-message": {
"type": "String",
"desc": "Validation error message (gets displayed only if 'error' is set to 'true')",
"examples": [ "Username must have at least 5 characters" ],
"category": "content"
},
"no-error-icon": {
"type": "Boolean",
"desc": "Hide error icon when there is an error",
"category": "content"
},
"rules": {
"type": "Array",
"desc": "Array of Functions/Strings; If String, then it must be a name of one of the embedded validation rules",
"examples": [
":rules=\"[ val => val.length <= 3 || 'Please use maximum 3 characters' ]\"",
":rules=\"[ 'fulltime' ]\""
],
"category": "behavior"
},
"reactive-rules": {
"type": "Boolean",
"desc": "By default a change in the rules does not trigger a new validation until the model changes; If set to true then a change in the rules will trigger a validation; Has a performance penalty, so use it only when you really need it",
"category": "behavior",
"addedIn": "v1.11.0"
},
"lazy-rules": {
"type": [ "Boolean", "String" ],
"desc": "If set to boolean true then it checks validation status against the 'rules' only after field loses focus for first time; If set to 'ondemand' then it will trigger only when component's validate() method is manually called or when the wrapper QForm submits itself",
"values": [ "(Boolean) true", "(Boolean) false", "ondemand" ],
"category": "behavior"
}
},
"methods": {
"resetValidation": {
"desc": "Reset validation status"
},
"validate": {
"desc": "Trigger a validation",
"params": {
"value": {
"type": "Any",
"desc": "Optional value to validate against",
"__exemption": [ "examples" ]
}
},
"returns": {
"type": [ "Boolean", "Promise<boolean>" ],
"desc": "True/false if no async rules, otherwise a Promise with the outcome (true -> validation was a success, false -> invalid models detected)",
"examples": [
"true",
"validate().then(outcome => { ... })"
]
}
}
}
}