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

Simple API injection proposal for custom user componentisation #42

Closed
sgobotta opened this issue Dec 24, 2018 · 1 comment
Closed

Simple API injection proposal for custom user componentisation #42

sgobotta opened this issue Dec 24, 2018 · 1 comment
Assignees
Labels
proposal ideas, functional features, etc

Comments

@sgobotta
Copy link
Member

#34 inspired me to experiment with functional rendering and jsx syntax in Vue. I took into consideration a few aspects while working on it:

  • it is possible to inject props and functionality in custom components passed to Resource using JSX syntax, though it's not very popular among Vue developers. We would also be forcing them (users) to take a strange path when building their own components for a view in JSX syntax, since most Vue UI frameworks use the tag to layout their interfaces.
  • Similar to the previous consideration, we could build custom components, such as buttons, textfields, forms, pagination tables, that would behave as wrappers and trigger different actions (a submit button would store information in database, for example.). We will have to somehow interact between the form elements and keep track of the inputted information before a database call is requested.
  • Since it's possible to pass a component by props, I thought a simple set of a few functions can be injected into a user component, so that any form input and button in any view behave the way we expect. We let users build their own interfaces and we provide the event listener and submitting functions for their elements. We still take care of keeping track of their form data and do the database calls when requested.
  • The third idea led me to implement a simple API that could be injected to any user component that is passed to Resource as a prop.

@sgobotta sgobotta added the proposal ideas, functional features, etc label Dec 24, 2018
@sgobotta sgobotta self-assigned this Dec 24, 2018
@glmaljkovich
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal ideas, functional features, etc
Projects
None yet
Development

No branches or pull requests

2 participants