phoenix中 link 链接

1 <.link href={~p"/users/#{user.id}"} method="get">Log in</.link>
 1  def show_user(assigns) do
 2       ~H"""
 3         <.link href={~p"/users/#{@id}"} method="get">View</.link>
 4       """
 5     end
 6 
 7 
 8 <%= for user <- @users do %>
 9 <tr>
10   <td><b><%= first_name(user) %></b> (<%= user.id %>)</td>
11 
12   <br/>
13   <.show_user id={user.id} />
14 </tr>
15 <% end %>

 

posted on 2024-07-22 13:46  c3tc3tc3t  阅读(6)  评论(0编辑  收藏  举报