$data as JSON #3130
Replies: 1 comment 1 reply
-
If you are only interested in the component scope (no parents), you can do
If you also need parent data, you can slightly modify the above to It only protects you from _x_dataStack being renamed and, despite being on the public interface, is not documented. $data is a proxy around an empty object whose getter and setter read/write from/to the closest data stack. I'm not sure if there is an appetite for making all Alpine proxies serializable but it's probably possible by overriding |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there any way to access $data as a serializable object? right now i'm doing this but due its hackish nature it could break if some of those private props change in the future and $data itself looks like a proxy returning an empty object
Beta Was this translation helpful? Give feedback.
All reactions