我正在尝试将一个值从浏览器(例如,localstorage)传递到服务器,并在安装实时模板(leex)并创建 UI 视图时使其可用。仅尝试以下操作以获取如下所示的消息。
<JS>
let liveSocket = new LiveSocket("/live", Socket, {params: {init_state: "value from localstorage"}..
<Phoenix>
def mount(params, _session, socket) do
IO.inspect(params) # this returns "not route mounted"