2022-11-02 21:36:48 +03:00

19 lines
413 B
JavaScript

/* eslint-disable import/prefer-default-export */
import { useStore } from 'stores/hooks';
export function useValidation(elementName) {
const { $calculation } = useStore();
const messages = $calculation.$validation[elementName]?.getMessages();
if (messages?.length) {
return {
isValid: false,
help: 'Некорректные данные',
};
}
return {
isValid: true,
};
}