import { css, customElement, html, LitElement, property } from 'lit-element'; /** * An example element. * * @slot - This element has a slot * @csspart button - The button */ @customElement('ms-autocomplete') export class MSAutocomplete extends LitElement { static styles = css` :host { display: block; border: solid 1px gray; padding: 16px; max-width: 800px; } `; @property({ type: String }) model = 'test'; @property({ type: Array }) data = []; constructor() { super() } onchangeHandler(e: any) { this.model = e.target.value } render() { console.log(this.data); return html` this.model = e.target.value}> ${(this.data || []).map((item: any) => html` `; } } declare global { interface HTMLElementTagNameMap { 'ms-autocomplete': MSAutocomplete; } }