You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constalpineElement=document.querySelector('[x-data]');// some Alpine.js component root;constphxEl=alpineElement.closest('[data-phx-view]');if(phxEl){constview=window.liveSocket.getViewByEl(phxEl);returnview.name;}
From a quick look, I think we could even use: phxEl.dataset.phxView
When an Alpine.js component is detected inside of a LiveView view, use
view.name
as the name of the component.The text was updated successfully, but these errors were encountered: