lit-html

how to Implement lit-element-bootstrap package in lit-lement

僤鯓⒐⒋嵵緔 提交于 2019-12-11 15:53:55
问题 I would like to implement lit-element-bootstrap package in lit-element. I am getting following error in console, Failed to load module script: The server responded with a non-JavaScript MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec //header.js import { LitElement, html, css } from 'https://unpkg.com/@polymer/lit-element/lit-element.js?module'; import 'https://unpkg.com/lit-element-bootstrap@1.0.0-alpha.10/lit-element-bootstrap'; export class

How to set checked attribute to radio in litelement

半腔热情 提交于 2019-12-11 14:58:34
问题 I would like to know how to set checked to radio button using litelement. I have a object and for each object options, radio button is created. For example, for id=SG two radio buttons are created, if no checked, set bank as default checked else set corresponding selected radio value as checked. I got stuck in litelement. const obj= [{ id: "SG", options: ["bank", "credit"] }, { id: "TH", options: ["bank"] } ]; render(){ ${obj.map((e)=>{ return html` <form> ${obj.options.map((option_value)=>{

How to apply global css to web components through shadow-dom

大憨熊 提交于 2019-12-11 03:21:37
问题 I'm working on a lit-element project, and I got a problem that reset.css cannot be applied to web components wrapped with shadow-root I've tried this way, and I got this following error. Refused to apply style from 'http://localhost:8080/style/static/reset.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled. The code I tried is this: <script> var css = new CSSStyleSheet() css.replace('@import url("./style/static/reset.css")')