Is it OK to use Alpine.$data to access x-data of an element from another JS function #3592
Unanswered
davidcotter
asked this question in
1. Help
Replies: 1 comment 4 replies
-
Well, don't use But it would likely be smarter to hook this up inside the data context to begin with |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a
<div>
which appears ifisOn
is true thus:I have a JS callback from another library (plotly) that I want to use to control the appearance of the div and pass other data to the div
x-data
:This works perfectly but I couldn't find any discussion or documentation for
Alpine.$data
- is this likely to break in the future or is this a stable feature? Is there a better way to do what I want - e.g. with store which was a bit more verbose?Thank you.
Beta Was this translation helpful? Give feedback.
All reactions