Questions tagged [lit-element]

A base class for creating custom elements with the Lit JS library.

LitElement makes it easy to define web components using /Lit. LitElement allows you to declare reactive properties that re-render the component and reflect to attributes.

It uses to render DOM.

677 questions
0
votes
1 answer

How to set/override Lit-Element typescript property decorator by parsing value in index.html custom element?

I am trying to override a set property in lit-element. I am using Typescript and I am setting the value using a decorator in the custom element, although when I try to override the element by setting a different attribute in the index.html it…
jmoore255
  • 321
  • 4
  • 15
0
votes
1 answer

Lit-Elements external js file as storage changed by a property data binding

i try to use in lit-elements a external js file for init values but if i do so, it isnt changebel anymore via property binding. if i write it without the extanal storage file just use this. scope and declare it in the constructor, everything works…
0
votes
1 answer

`this` is lost when I use lit-html expressions

I'm training with LitElement and lit-html. I'm trying to make complex templates with functions and event listener. I have a module for the template module and another for one component where I use the templates. I'm having problem with a template…
0
votes
1 answer

binding with polymer lit-element 0.6.2 dosn't work

i have update version of polymer lit-element from 0.5.2 to 0.6.2 and the binding dosn't work what I wrong? this the html:
Angelotti
  • 673
  • 1
  • 6
  • 20
0
votes
0 answers

Open a new Page on NodeJS Server with Javascript and add some stuff?

I code a webapp and now i want to open a new Window using JS and inserting some code in the new Window. This is the code I already tried, but with no success: var win = window.open("TimeTableView.html", "_blank"); var pTag =…
0
votes
1 answer

Litelement querySelector is Null

I have a Parent file index.js that renders child tag counter.js. Whenever a property in child is changed a event is triggered and parent listens it. For this to work, I have to render both tags in index.html else index.js is unable to listen as…
Yodha
  • 45
  • 9
0
votes
0 answers

ES6 dynamic imports with expressions

I am trying to dynamically load a module depending on the sub-class' class name. The code could be seen here: const name = this.constructor.name; import( `../../src/components/${name}/View/${name}.js`).then((module) => { }); I am using a mixin…
0
votes
1 answer

Lit-Element doesn't let me set property value in html

I have a issue with a as specific element I'm working on. And for some reason this one doesn't let me specify any property values on the html tag. If I specify defaults in the contructor, then the element works fine with those defaults, but I cannot…
Andre
  • 1,292
  • 1
  • 17
  • 34
0
votes
1 answer

lit-element : Uncaught (in promise) TypeError: Cannot read property 'previousSibling' of null

On migration to lit-element version 0.6.0. If I use 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
1 answer

How do I consume a polymer lit-element?

I have a litElement that I will need to consume from another domain. My browser is Chrome, I am using 'polymer serve' and navigating directly to the es5-bundle. The lit-element is very simple. Just some static text. When I use 'polymer build' my…
Don Chambers
  • 3,798
  • 9
  • 33
  • 74
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
0
votes
1 answer

shady-render.ts:46 Uncaught TypeError: result.getTemplateElement is not a function

When I try executing Polymer element locally,I am using polymer 3 and my HTML structure is HTML5. The counter-comp tag is added in my html file. import {LitElement} from "@polymer/lit-element/lit-element.js" class CounterComp extends…
-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

Apply CSS class to the body when opening a menu

I'm currently working on a web project using LitElement, and I have a menu that shows when I click the hamburguer button, and closes when I click the close button or navigate to other page. My problem is that I want to apply the CSS property…
1 2 3
45
46