-
Notifications
You must be signed in to change notification settings - Fork 7
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
Vue instance available in click event in schema? #10
Comments
Hey @lsbyerley, sorry for the delay. Been off-grid last week! |
@gahabeen This one was not opened by me 😅 |
Sorry about that ping ;P |
@lsbyerley So far there is no context bound to the event function. Feel free to dive into it to add this feature if you want to. Pull requests are always appreciated. |
@lsbyerley if you're using ES6 you can simply change your syntax slightly to get access to your vm (this) if that's what you're after... data() {
return {
schema: [
...
{
component: 'div',
class: 'flex align-center justify-between',
children: [
...
{
type: 'button',
name: 'forgot-password',
label: 'Forgot Password',
on: {
click: (event) => {
console.log(this); // VueComponent
console.log(event); // MouseEvent
},
},
},
],
},
],
};
}, |
I'd like to call a method or emit an event from a click even in the schema but
this
is undefined. Is there a way to do this with this plugin? Example belowThe text was updated successfully, but these errors were encountered: