39 lines
1,015 B
Elixir
39 lines
1,015 B
Elixir
defmodule MvWeb.MembersLive do
|
|
use MvWeb, :live_view
|
|
alias PrimerLive.Component, as: Primer
|
|
|
|
def mount(_params, _session, socket) do
|
|
# Initialize any state you need here
|
|
{:ok,
|
|
assign(
|
|
socket,
|
|
:title,
|
|
"Willkommen zur test Live View für PrimerLive bis hier members gezeigt werden..."
|
|
)}
|
|
end
|
|
|
|
def render(assigns) do
|
|
~H"""
|
|
<div>
|
|
<h1 class="h1"><%= @title %></h1>
|
|
<Primer.state_label is_draft>Entwurf</Primer.state_label>
|
|
<Primer.subhead>
|
|
<span class="h2">Heading</span>
|
|
<:actions>
|
|
<Primer.button is_primary>Action</Primer.button>
|
|
</:actions>
|
|
<:description>
|
|
Description
|
|
</:description>
|
|
</Primer.subhead>
|
|
<Primer.button is_danger phx-click="click_me">Click Me!</Primer.button>
|
|
</div>
|
|
"""
|
|
end
|
|
|
|
def handle_event("click_me", _value, socket) do
|
|
# Handle the button click event
|
|
new_title = "You clicked the button!"
|
|
{:noreply, assign(socket, :title, new_title)}
|
|
end
|
|
end
|