<dependencies>
<dependency>
<groupId>com.vaadin.flow</groupId>
<artifactId>vaadin-element-mixin</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.Tag;
import com.vaadin.flow.component.dependency.JsModule;
@Tag("my-custom-element")
@JsModule("./src/my-custom-element.js")
public class MyCustomElement extends Component {
}
js
import { PolymerElement, html } from '@polymer/polymer/polymer-element.js';
class MyCustomElement extends PolymerElement {
static get template() {
return html`
<style>
:host {
}
</style>
`;
}
}
customElements.define('my-custom-element', MyCustomElement);
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.Route;
@Route("")
public class MainView extends VerticalLayout {
public MainView() {
MyCustomElement customElement = new MyCustomElement();
add(customElement);
}
}