I’m trying to hide multiple elements inside the DOM by changing shared state when window is resized. And when i try to It should change the state ** hideOnMobile** to true but it doesn’t somehow any idea? Answer Have you tried using @resize.window? (ie. adding the resize listener using Alpine.js) it should make your code simpler than using window.onresize +
Tag: alpine.js
AlpineJs Extract value from select[option]
Trying to use the x-model.number to get values from select option to calculate the values. Using the below input text works. How do I translate it on the select option? Answer I believe it should work by putting the x-model on the select instead of the option. To make the selected state be correct, it’s also probably a good idea
How to access a property or a method of alpine.js parent component from a child component?
This is kind of an example scenario what the problem looks like, It would be able to increase/decrease the data count from the child component. I thought of handling it through dispatching custom events using $dispatch() but then again in terms of design, I might need to write listeners on both parent and child component which make the logic more
Alpine.js – nested components
I have code like this with nested components: but it seems it does not work. Is there any why to make it work using nested components or maybe Alpine.js cannot handle this yet? OF course I’m aware that changing: into would solve the issue, but this way I would have single component. Answer Alpine.js doesn’t support nesting as of v2.x