Skip to content
Discussion options

You must be logged in to vote

oh, you mean, have like a property on the x-data that auto binds stuff.

So you can add to your data

init() {
  Alpine.bind(this.$root, this.root)
}

And it would do that.

Also, as a style thing, the normal way to define a method on an object is

["x-on:click.capture"](event) {
    this.click(event);
}

not with a function expression

Replies: 2 comments 11 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
11 replies
@SimoTod
Comment options

SimoTod Jul 12, 2024
Collaborator

@ekwoka
Comment options

@y1n0
Comment options

@ekwoka
Comment options

Answer selected by manuelmeister
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants