Closed Yelrado closed 2 years ago
Thats a good question. It's something Ive been working on. I want to make it possible for people to provide error messages. It's still a work in progress which is why I havent written any docs on it, but I think it will be a really good addition.
How are you using this? I didnt think anyone would run into issues with it since it shouldnt impact anything yet,
I was experimenting on checking if VInput had errors and if so pass a boolean to another component.
<template>
<Vinput />
<OtherComponent :error="errorInVInput" />
</template>
@Component
class Root extends Vue {
private errorInVInput = false;
}
I guess I have to use $emit in order to set errorInVInput to a different value when VInput has errors but I'm string learning that.
That is a good use case that I think I hadnt accounted for. I think the ideal experience would be for the input component to emit a validation event, but that does not currently exist.
Can you send me a full example with codesandbox.io?
As it turned out, errors.get
was a typo in my code. This error should be fixed with the latest version.
The VInput will take an Object but will fail at this line
https://github.com/AustinGil/Vuetensils/blob/e3129d6fea351d47a9563d5ec9059faa64030eee/src/components/VInput/VInput.vue#L243
I was able to fix it by changing
errors.get(key)
toerrorsMap.get(key)
but still not sure what's the purpose.