module Lucky::MountComponent
Direct including types
Defined in:
lucky/mount_component.crInstance Method Summary
-
#mount(component : Lucky::BaseComponent) : Nil
Appends the
component
to the view. -
#mount(component : Lucky::BaseComponent, &) : Nil
Appends the
component
to the view.
Instance Method Detail
def mount(component : Lucky::BaseComponent) : Nil
#
Appends the component
to the view.
When Lucky::HTMLPage.settings.render_component_comments
is
set to true
, it will render HTML comments showing where the component
starts and ends.
mount MyComponent.new
def mount(component : Lucky::BaseComponent, &) : Nil
#
Appends the component
to the view. Takes a block, and yields the
args passed to the component.
When Lucky::HTMLPage.settings.render_component_comments
is
set to true
, it will render HTML comments showing where the component
starts and ends.
mount MyComponent.new("jane") do |name|
text name.upcase
end