13 lines
396 B
JavaScript
13 lines
396 B
JavaScript
/* eslint-disable import/prefer-default-export */
|
|
import { useStore } from 'stores/hooks';
|
|
|
|
export function useValidation(elementName) {
|
|
const { $calculation } = useStore();
|
|
const validationResult = $calculation.$validation.getValidation(elementName);
|
|
|
|
return {
|
|
...validationResult,
|
|
help: validationResult?.isValid === false ? 'Некорректные данные' : null,
|
|
};
|
|
}
|