-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
Define available callbacks for events used as directives #40
Comments
So you proposing to add Monkberry.render(Template, el, {methods:
callback: () => {...}
}); |
Yes, but I'm unsure that "methods" is the right term. A method is in the context of the OOP. But it is precisely in order to avoid OOP that I need this feature. If callbacks is not correct, maybe "functions"? Or "procedures"? Or perhaps we can consider it is a way to provide methods of the template (the template is like an instance), but IMO it's not the proper term because we don't use |
|
It is my first proposition. A callback is:
We can consider that we pass a list of callbacks as arguments to the code of the template, which we expect that they will be called back at some convenient time. It seems OK. It depends on which is the syntax in the template, too. For example, we want to define a callback named
or with a prefix (if we need a prefix, then I suggest
Without a prefix, a
However, if the syntax requires a prefix, then I think it would be better to use the same prefix in options:
|
Maybe allow to use or not prefixes? Monkberry.render(Template, el, {
callbacks: {
controller: {
onChangeText: (event) => {...}
}
}
}); |
I'd like that! |
Will try to implement it in next release. |
Hello, is there a date scheduled for the release of this feature? |
Hi, |
Hi, thanks for this amazing template engine. Here is a suggestion.
I currently use events with this kind of code:
I would like to configure available callbacks the same way as for directives:
I prefer to not extend the template class. I just need to define available callbacks, like
methods
in Vue.NB: Personally, I would prefer to use the delegating way. But I can't, because the selector is applied after the rendering of directives. I have sub-components included by directives. The following code interferes with DOM nodes of the sub-components:
IMO the selector should be applied before to render the directives.
The text was updated successfully, but these errors were encountered: