x-data does not get updated in same element when externalized #4389
Unanswered
simonferndriger
asked this question in
5. Bugs
Replies: 2 comments 1 reply
-
Not sure if that answers your question, but I use this pattern, that I saw in the Alpine.bind() docs: Alpine.bind('SomeButton', () => ({
'x-data'() { return {
init() {
// some init code, no need for an extra x-init prop
},
someOtherMethod() {
}
}
},
'@click'() {
this.doSomething()
},
':disabled'() {
return this.shouldDisable
},
})) |
Beta Was this translation helpful? Give feedback.
1 reply
-
This may be a bug with how init is handled inside x-bind... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When I define
x-data
inside the element itself, everything works fine, even whenx-init
is declared outside the element:But as soon as I define
x-data
outside as well, it doesn't update the class in the element itself anymore, it still works on the child elements though at least whereactive
changes totrue
afterlist()
has been called.Why is that? Looks like a bug?
Beta Was this translation helpful? Give feedback.
All reactions