2023-02-06 12:19:39 +03:00

18 lines
365 B
JavaScript

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