Closed uncleGena closed 5 years ago
This is a left-over sentence from the old behavior, sorry about that.
There are a couple of things that prevented vee-validate from keeping those components renderless:
v-slot
Can only be used on components or template
tags, unlike the deprecated slot-scope
which can be used on any element.This means that vee-validate had to force the users to keep in mind that they must have 1 root element inside the provider and prevent them from using template
tags since they always have more than 1 root element. This would make vee-validate incompatible with 50% of API and not intuitive for the new developers since it would have too many caveats for my taste.
Anyways, regarding your issue. Providers and observers tags can be customized using the tag
prop, and they inherit any attrs added on them, so you can add class
or style
and it would not block those attrs.
Here is an example, where I used both class
and style
and it proxied properly to the div tag I specified.
https://codesandbox.io/s/1rmn5j5q8l
I will make sure to fix the docs sentence.
so you can add
class
orstyle
and it would not block those attrs.
Good! I thought I've checked that right. Must be my mistake... Thank you.
here is a sentence which says
While I cant understand that sentence, I have a small hope that there is a way to remove that wrapper element. Is there any problem to do renderless component? Or at least provide a
class
attribute to ValidationProvider?