Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Field :as prop is not working with globally defined components #3014

Closed
juan267 opened this issue Nov 6, 2020 · 4 comments
Closed

Field :as prop is not working with globally defined components #3014

juan267 opened this issue Nov 6, 2020 · 4 comments
Labels
🐛 bug Unintended behavior

Comments

@juan267
Copy link

juan267 commented Nov 6, 2020

Versions

  • vee-validate: 4.0.0-beta.18
  • vue: 3.0.2

Describe the bug

Docs state that you can do the following:

<Field name="field" as="my-text-field" />

And field would render the my-text-field component if it's globally registered. But this is not working instead tags gets render in the html like if Vue didn't know about the component.

To reproduce
Steps to reproduce the behavior:

  1. Create a BaseInput component
  2. Register it globally
  3. Pass it's name as the value for the as prop for the Field component
<Field name="field" as="BaseInput" />
  1. No BaseInput component gets render

Expected behavior
Field should render the BaseInput component.

Demo link
Codesandbox.

Desktop (please complete the following information):

  • OS: macOs
  • Browser Chrome
@logaretm
Copy link
Owner

logaretm commented Nov 7, 2020

I had assumed that h would resolve any global components, looks like a mistake on my part. Will what I can do.

@logaretm logaretm added the 🐛 bug Unintended behavior label Nov 7, 2020
@logaretm
Copy link
Owner

logaretm commented Nov 7, 2020

The issue was resolved and will be available in the next release in a few hours. Thank you for reporting this.

@logaretm logaretm closed this as completed Nov 7, 2020
@webdesignberlin
Copy link

Hi, any possibility to use local custom component in as-tag? or the only way to register globally?

@logaretm
Copy link
Owner

logaretm commented Dec 7, 2020

@webdesignberlin You should be able to use local components just fine. It is similar to component :is prop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants