Replies: 2 comments
-
I've got the same questions… Any hint? I try to get a demo running (ToDo MVC) with the persist plugin, but I didn't get it to work: https://codepen.io/jonnitto/pen/OJmEKpw |
Beta Was this translation helpful? Give feedback.
0 replies
-
You need to use a standard function. document.addEventListener('alpine:init', () => {
Alpine.data('find', function() {
return {
range: this.$persist(50)
}
})
}) |
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
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
I'm loving Alpine v3. I have a question about how to use plugins and magic properties inside
Alpine.data()
. I know that things likethis.$refs
work just fine, but I'm unable to use the persist plugin like so:I noticed that the documentation on this plugin doesn't show any examples on how to accomplish this either. Is there any way for me to replicate the plugin without using it inside the
x-data
attribute?Beta Was this translation helpful? Give feedback.
All reactions