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 SawirOP16mo ago
failed to compile to correct html I mean
awcodes
awcodes16mo ago
Try putting a : in front of wire. Without it just gets treated as a sting instead of evaluating it.
Ricardo Sawir
Ricardo SawirOP16mo ago
Tried, didnt for me
awcodes
awcodes16mo ago
What does the actual @js call render too.
Ricardo Sawir
Ricardo SawirOP14mo ago
just @js in a string
cheesegrits
cheesegrits14mo ago
Where / how are you rendering this?
Ricardo Sawir
Ricardo SawirOP14mo ago
<x-filament::button wire:click="doMethod(@js($data))">
cheesegrits
cheesegrits14mo ago
Yes, but where? In a view? In a custom field? What's the context?
Ricardo Sawir
Ricardo SawirOP14mo ago
in a view, and also in Blade::render()
Want results from more Discord servers?
Add your server