Questions tagged [lit-html]

Lit is a JS web component library. Lit HTML is the render component that uses tagged template literals to only update the parts of the DOM that have changed. Use this tag on questions related to using it standalone, and in components other than those based on LitElement.

is a JS web component library.

Lit HTML uses tagged template literals to build DOM that can be reused. It can be used standalone to build components or render DOM without the .

236 questions
0
votes
2 answers

How do I add lit-html to an existing project?

I understand I can import lit-html using a in the header part of my document. I have the following error : Uncaught (in promise) TypeError: Cannot…
vdegenne
  • 12,272
  • 14
  • 80
  • 106
0
votes
3 answers

how to embed html code in template in polymer3 (like unsafeHTML)

please check the plunker static get template() { return html`

This content is from ChildClass.

${super.template}

Hello again from ChildClass.

[[partHtml]] <==== this should be…

Kent Wood
  • 1,392
  • 2
  • 14
  • 30
0
votes
1 answer

Meteor + LitElement (Polymer 3) issue with importing

I had an issue with importing the LitElement module into a Meteor project: I'm starting a new test project with Meteor 1.7+ and am using LitElement for a few components. I installed Meteor like so: meteor create meteor-lithtml --release…
Aaron
  • 3,068
  • 2
  • 21
  • 44
-1
votes
2 answers

Convert to if/else from nested ternary in lit-html

how to write below code lit html I am new to lit html , i try to convert the below code to if/else instead of nested ternary render() { return this.html` ${this.data ? this.html`` :…
John Ken
  • 898
  • 1
  • 13
  • 26
-1
votes
1 answer

Suggest a way to make lit-element reactive properties work with ecma 2022 private fields

Recently we got a new ECMA 2022 standard approved and there is now a syntax to support private fields natively by prefixing # to the name. For years we have been using _ conventionally and now there is some space for confusion of # and _. The…
Max Larionov
  • 420
  • 6
  • 19
-1
votes
1 answer

How to minify Lit-HTML (including comments)

I decided to try out lit-html via: npm install lit-html --save I've heard numerous times (from various sources) that lit-html is only 2 or 3KB in size, but by only importing the html and render exports it caused my webpack to grow over 13KB. That's…
Lonnie Best
  • 9,936
  • 10
  • 57
  • 97
-2
votes
1 answer

Lit-HTML Button Event Inside Google Marker Infowindow

I am working on building a google map using LIT-HTML, I have a list of places that display on the map, when you click the marker an infowindow pops up. I want to add a button with a click event to this info window but I can not figure out how to…
Pasq
  • 81
  • 1
  • 3
-3
votes
2 answers

Getting error while using Decorators in js

I'm trying to write a simple web component using LitElement. When I try to use: - @customElement('my-element') - @property() I'm getting error. Support for the experimental syntax 'decorators-legacy' isn't currently enabled. Is this…
kutty
  • 1
  • 1
1 2 3
15
16