using @js in <x-filament::button wire:click="doMethod(@js($data))"> will fail

using @js in <x-filament::button wire:click="doMethod(@js($data))"> will fail
9 Replies
Ricardo Sawir
Ricardo SawirOP2y ago
failed to compile to correct html I mean
awcodes
awcodes2y ago
Try putting a : in front of wire. Without it just gets treated as a sting instead of evaluating it.
Ricardo Sawir
Ricardo SawirOP2y ago
Tried, didnt for me
awcodes
awcodes2y ago
What does the actual @js call render too.
Ricardo Sawir
Ricardo SawirOP17mo ago
just @js in a string
cheesegrits
cheesegrits17mo ago
Where / how are you rendering this?
Ricardo Sawir
Ricardo SawirOP17mo ago
<x-filament::button wire:click="doMethod(@js($data))">
cheesegrits
cheesegrits17mo ago
Yes, but where? In a view? In a custom field? What's the context?
Ricardo Sawir
Ricardo SawirOP17mo ago
in a view, and also in Blade::render()

Did you find this page helpful?