You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be useful to be able to have a directive like “x-if” in AlpineJS, where the element is rendered only if the condition in the attribute is true.
You can use “data-wp-bind--hidden” hides only the element in the dom rendering it anyway.
Also, “data-wp-bind” does not support comparison operations and wants the boolean value directly. e.g:
❌ data-wp-bind--hidden="context.day < 1”
A directive like “data-wp-if” would make it much easier to develop components, even the most complex ones.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi guys.
It would be useful to be able to have a directive like “x-if” in AlpineJS, where the element is rendered only if the condition in the attribute is true.
You can use “data-wp-bind--hidden” hides only the element in the dom rendering it anyway.
Also, “data-wp-bind” does not support comparison operations and wants the boolean value directly. e.g:
❌ data-wp-bind--hidden="context.day < 1”
A directive like “data-wp-if” would make it much easier to develop components, even the most complex ones.
Beta Was this translation helpful? Give feedback.
All reactions