Sha256: e813e3038eb8890256ebd6f0dbe27eebbd916482b2e39d43cb29b8bb2ee9a3a6

Contents?: true

Size: 670 Bytes

Versions: 18

Compression:

Stored size: 670 Bytes

Contents

module Inesita
  module Component
    include VirtualDOM::DOM
    include VirtualDom
    include Render
    include Cache
    include Injection

    def self.included(base)
      base.extend Inesita::Component::ClassMethods
    end

    def mount_to(element)
      raise Error, "Can't mount #{self.class}, target element not found!" unless element
      @root_component = self
      init_injections
      inject
      @virtual_dom = render_virtual_dom
      @root_node = VirtualDOM.create(@virtual_dom)
      Browser.append_child(element, @root_node)
      self
    end

    attr_reader :props
    def with_props(props)
      @props = props
      self
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
inesita-1.0.pre.9 opal/inesita/component.rb
inesita-1.0.pre.8 opal/inesita/component.rb
inesita-1.0.pre.7 opal/inesita/component.rb
inesita-1.0.pre.6 opal/inesita/component.rb
inesita-1.0.pre.5 opal/inesita/component.rb
inesita-1.0.pre.4 opal/inesita/component.rb
inesita-1.0.pre.3 opal/inesita/component.rb
inesita-1.0.pre.2 opal/inesita/component.rb
inesita-1.0.pre.1 opal/inesita/component.rb
inesita-0.9.2 opal/inesita/component.rb
inesita-0.9.1 opal/inesita/component.rb
inesita-0.9.0 opal/inesita/component.rb
inesita-0.8.2 opal/inesita/component.rb
inesita-0.8.1 opal/inesita/component.rb
inesita-0.7.0 opal/inesita/component.rb
inesita-0.6.1 opal/inesita/component.rb
inesita-0.6.0 opal/inesita/component.rb
inesita-0.6.0.beta.1 opal/inesita/component.rb