Reputation: 3
I am filtering a grid of logos based on a category that is contained in an array of data. I am having trouble getting the syntax correct for pulling the category into the x-show directive. Here is what I have that is not working-
x-show="tab === '${item.cat}
' || tab === 'all'"
Can someone please show me what the correct syntax would be?
Upvotes: 0
Views: 676
Reputation: 10577
Inside a directive you use regular JS, therefore:
x-show="tab === item.cat || tab === 'all'"
Or use backticks (`) for template literals.
Upvotes: 1