Skip to content

vite-lit demos

Online Demos

usage from @0.3.0

For example, like vite-vue , vue version >=3.2.0

markdown code
md
      
      null
    
import { LitElement, html } from 'lit'
import { customElement, property } from 'lit/decorators.js'

@customElement('my-element')
export class MyElement extends LitElement {
  @property()
  msg = 'Hello world'

  render() {
    return html`<h1>${this.msg}</h1>`
  }
}

declare global {
  interface HTMLElementTagNameMap {
    'my-element': MyElement
  }
}

Open on CodeSandboxOpen Sandbox

Released under the MIT License.