Toggle switch outside of form context
I'm trying to set up the Toggle Switch component to toggle the visibility of a view, but I'm not really sure on how to hook up the switch to an event handler. The documentation only shows how to integrate it into a form, but LiveView doesn't track form field values (I think?) so it would not rerender on toggle. I don't really want to setup a client-side hook for this, so I'm wondering if there's a straightforward way to set this up all in LiveView.
关闭于 2024-11-06 2 条评论