Function is not evaluated with x-show directive #2263
Unanswered
petehouston
asked this question in
5. Bugs
Replies: 1 comment
-
Your example doesn't have x-data! |
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.
-
After reading the docs, I wonder if
x-show
can evaluate function as the doc doesn't say it.However, reading the code for
x-show
, I can see it should evaluate if the expression type is a function.https://github.com/alpinejs/alpine/blob/main/packages/alpinejs/src/directives/x-show.js#L7
https://github.com/alpinejs/alpine/blob/main/packages/alpinejs/src/evaluator.js#L30
I tried with this simple piece of code, and it doesn't work with function.
I wonder if this is a bug or function is not supported (should not be passed into) for
x-show
directive.Beta Was this translation helpful? Give feedback.
All reactions