Class: Matestack::Ui::Bootstrap::Components::Dropdown

Inherits:
BaseVueJsComponent show all
Defined in:
lib/matestack/ui/bootstrap/components/dropdown.rb

Instance Method Summary collapse

Instance Method Details

#prepareObject



16
17
18
# File 'lib/matestack/ui/bootstrap/components/dropdown.rb', line 16

def prepare
  @bs_menu = context.menu.is_a?(Hash) ? context.menu : { items: context.menu }
end

#responseObject



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/matestack/ui/bootstrap/components/dropdown.rb', line 20

def response
  div dropdown_attributes do
    split_btn_partial if slots && slots[:split_btn]
    bs_btn btn_attributes unless slots && slots[:split_btn]

    ul menu_attributes do
      menu_partial unless @bs_menu[:items].blank?
      yield if block_given?
    end
  end
end