LiveView Basics
A LiveView
This LiveView uses only render/1
.
Documentation:
https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html#c:render/1
scope "/", LiveViewBasicsWeb do
pipe_through :browser
live "/render", RenderLive
end
defmodule LiveViewBasicsWeb.RenderLive do
use LiveViewBasicsWeb, :live_view
def render(assigns) do
~H"""
<Layouts.app flash={@flash}>
<div class="hero min-h-screen">
<div class="hero-content text-center">
<div>
<h1 class="text-4xl font-bold">LiveView Basics</h1>
<h2 class="text-xl">A LiveView</h2>
<p class="py-6">
This LiveView uses only <code class="bg-base-content text-base-100">render/1</code>.
</p>
</div>
</div>
</div>
</Layouts.app>
"""
end
end