Class LitTemplate
- All Implemented Interfaces:
AttachNotifier,DetachNotifier,HasElement,HasStyle,Template,Serializable
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/
- Since:
- Author:
- Vaadin Ltd
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates the component mapped to a LitElement.protectedLitTemplate(LitTemplateParser parser, VaadinService service) Creates the component component mapped to a LitElement using the providedparserandservice. -
Method Summary
Modifier and TypeMethodDescriptionGets the child components of this 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, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Constructor Details
-
LitTemplate
protected LitTemplate()Creates the component mapped to a LitElement.The call is delegated to
LitTemplate(LitTemplateParser, VaadinService)viaVaadinService.getCurrent()as a service and parser created viaLitTemplateParser.LitTemplateParserFactoryretrieved fromInstantiator.- See Also:
-
LitTemplate
Creates the component component mapped to a LitElement using the providedparserandservice.- Parameters:
parser- a template parserservice- the related service instance
-
-
Method Details
-
getChildren
Gets the child components of this component.The default implementation finds child components by traversing each child
Elementtree.If the component is injected to a PolymerTemplate using the
@Idannotation the getChildren method will only return children added from the server side and will not return any children declared in the template file.Please note that components defined using
@Idare not child components. Only components explicitly added through methods such asHasComponents.add(com.vaadin.flow.component.Component...)orNode.appendChild(Element...)are returned by this method.- Overrides:
getChildrenin classComponent- Returns:
- the child components of this component
- See Also:
-