问题描述
我想通过以下功能将事件从liveView服务器发送到客户端:
def handle_event("test",_,socket) do
{:noreply,push_event(socket,"testEvent",%{coins: 23,user: "user"})}
end
这在liveview的文档中有非常相似的解释。 https://hexdocs.pm/phoenix_live_view/js-interop.html 但我收到此错误消息:
(CompileError) undefined function push_event/3
Stacktrace:
│ (elixir 1.10.4) src/elixir_locals.erl:114: anonymous fn/3 in :elixir_locals.ensure_no_undefined_local/3
│ (stdlib 3.8) erl_eval.erl:680: :erl_eval.do_apply/6
我错过了一些进口吗?还是我做错了什么?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)