defmodule MoonWeb.Examples.Design.MenuItemExample.MultiTitle do @moduledoc false use Moon.StatefulComponent use MoonWeb, :example alias Moon.Design.MenuItem alias Moon.Lego alias Moon.Icons.{SportBadminton, ControlsChevronRight} data(selected0, :boolean, default: false) def render(assigns) do ~F"""
Lorem Ipsum is simply dummy text of the printing and typesetting industry Meta
Lorem Ipsum is simply dummy text of the printing and typesetting industry
""" end def handle_event("on_select" <> number, params, socket) do {:noreply, assign(socket, :"selected#{number}", Map.get(params, "is-selected") == "true")} end def code() do """ alias Moon.Design.MenuItem alias Moon.Lego alias Moon.Icons.{SportBadminton, ControlsChevronRight} data(selected0, :boolean, default: false) def render(assigns) do ~F\"""
Lorem Ipsum is simply dummy text of the printing and typesetting industry Meta
Lorem Ipsum is simply dummy text of the printing and typesetting industry
\""" end def handle_event("selected0, params, socket) do {:noreply, assign(socket, :selected0, Map.has_key?(params, "is_selected"))} end # please note that text property is used when no slot is given, e.g. flowing lines are equal # # Lorem Ipsum Dolor """ end end