Class LitTemplate

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.littemplate.LitTemplate
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasStyle, com.vaadin.flow.internal.Template, Serializable

public abstract class LitTemplate extends com.vaadin.flow.component.Component implements com.vaadin.flow.component.HasStyle, com.vaadin.flow.internal.Template
Component which renders a LitElement template.

A LitElement template is defined in a JavaScript module which should be placed inside the frontend folder and loaded using @JsModule. The tag name defined for the Lit template must be defined using @Tag on this class.

By annotating a field using @Id you can map a @Component instance to an element in the template, marked with an id attribute which matches the field name or the optionally given value to the annotation.

Note that injected components will have the same limitations as with PolymerTemplate.

For more information about the LitElement project, see https://lit-element.polymer-project.org/

Author:
Vaadin Ltd
See Also:
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Creates the component mapped to a LitElement.
    protected
    LitTemplate(LitTemplateParser parser, com.vaadin.flow.server.VaadinService service)
    Creates the component component mapped to a LitElement using the provided parser and service.
  • Method Summary

    Modifier and Type
    Method
    Description
    Stream<com.vaadin.flow.component.Component>

    Methods inherited from class com.vaadin.flow.component.Component

    addListener, findAncestor, fireEvent, from, get, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisible

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.vaadin.flow.component.AttachNotifier

    addAttachListener

    Methods inherited from interface com.vaadin.flow.component.DetachNotifier

    addDetachListener

    Methods inherited from interface com.vaadin.flow.component.HasElement

    getElement

    Methods inherited from interface com.vaadin.flow.component.HasStyle

    addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
  • Constructor Details

  • Method Details

    • getChildren

      public Stream<com.vaadin.flow.component.Component> getChildren()

      Please note that components defined using @Id are not child components. Only components explicitly added through methods such as HasComponents.add(com.vaadin.flow.component.Component...) or Node.appendChild(Element...) are returned by this method.

      Overrides:
      getChildren in class com.vaadin.flow.component.Component