web-component

Accessing childNodes of custom elments?

天大地大妈咪最大 提交于 2021-02-10 15:07:05
问题 This might be a bit confusing. I am trying to access innerHTML or childNodes from my custom element. Is it possible to get access to the original DOM structure from the web component import file? BEFORE attachShadow? In the below example I am trying to get access to the src of the two jookah-images from my jookah-gallery import file. Disclaimer: Im a total noob when it comes to shadow DOM and web components so if there are any major mistakes I'd love to understand why. Thanks for any help!

Accessing childNodes of custom elments?

亡梦爱人 提交于 2021-02-10 15:01:25
问题 This might be a bit confusing. I am trying to access innerHTML or childNodes from my custom element. Is it possible to get access to the original DOM structure from the web component import file? BEFORE attachShadow? In the below example I am trying to get access to the src of the two jookah-images from my jookah-gallery import file. Disclaimer: Im a total noob when it comes to shadow DOM and web components so if there are any major mistakes I'd love to understand why. Thanks for any help!

Unable to integrate stenciljs component in React application

北慕城南 提交于 2021-02-08 06:38:38
问题 I am trying to integrate the web component built using StencilJS but I get the following error. Uncaught (in promise) TypeError: Cannot read property 'isProxied' of undefined at initializeComponent ReactJS, index.js file => import {defineCustomElements} from 'my-modal/loader'; defineCustomElements(window); StencilJS component: import { Component, Prop, h } from '@stencil/core'; @Component({ tag: 'my-component', styleUrl: 'my-component.css', shadow: true }) export class MyComponent { @Prop()

Unable to integrate stenciljs component in React application

偶尔善良 提交于 2021-02-08 06:37:02
问题 I am trying to integrate the web component built using StencilJS but I get the following error. Uncaught (in promise) TypeError: Cannot read property 'isProxied' of undefined at initializeComponent ReactJS, index.js file => import {defineCustomElements} from 'my-modal/loader'; defineCustomElements(window); StencilJS component: import { Component, Prop, h } from '@stencil/core'; @Component({ tag: 'my-component', styleUrl: 'my-component.css', shadow: true }) export class MyComponent { @Prop()

main differences between lit-element & React [closed]

限于喜欢 提交于 2021-02-07 22:21:29
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 months ago . Improve this question I have learned and worked with "Lit-element" with some projects. But I have no experiences with working "React" before. Looking into React code it seems more similar to "Lit-Element". It is very helpful if someone can explain the main differences between the

main differences between lit-element & React [closed]

旧城冷巷雨未停 提交于 2021-02-07 22:20:36
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 months ago . Improve this question I have learned and worked with "Lit-element" with some projects. But I have no experiences with working "React" before. Looking into React code it seems more similar to "Lit-Element". It is very helpful if someone can explain the main differences between the

Are Web Components actually useable in IE11 and Edge?

回眸只為那壹抹淺笑 提交于 2021-02-05 20:19:25
问题 Web Components are the hot new thing, and a true web standard, everybody is talking about them and presumably using them, and they seemed like the perfect solution to a problem we have (sharing components across very different sites). So we build a couple of web components. The work fine in Chrome, but not in IE11. Use polyfills maybe? https://www.webcomponents.org/polyfills has a ton of polyfills, but IE11 keeps complaining about class . Compile down to ES5 perhaps? Various sources claim

Are Web Components actually useable in IE11 and Edge?

一笑奈何 提交于 2021-02-05 20:18:15
问题 Web Components are the hot new thing, and a true web standard, everybody is talking about them and presumably using them, and they seemed like the perfect solution to a problem we have (sharing components across very different sites). So we build a couple of web components. The work fine in Chrome, but not in IE11. Use polyfills maybe? https://www.webcomponents.org/polyfills has a ton of polyfills, but IE11 keeps complaining about class . Compile down to ES5 perhaps? Various sources claim

Test lit-element webcomponent with Karma

情到浓时终转凉″ 提交于 2021-01-29 11:28:51
问题 I am trying to create a blank project, like a template, using lit-html. I wanted to also add some testing capabilities, so i have been trying to get it to work with Karma. I can run a normal test, like an addition, without any errors, so i think Karma itself is running ok. but i can't run any test involving the webcomponent. I can't import the webcomponent! i am exporting the webcomponent with: export default class MyComponent ... and then on the test file i am importing it with: import

Creating a standalone web component build using as an IIFE

房东的猫 提交于 2021-01-29 11:26:44
问题 I have create a web component for displaying gists generally in any html content. I used the Lit Element Typescript Starter Project as a baseline and it comes with a rollup.config.js file. I changed the output format to iife and left the rest the same, with exception of the component and bundle names. The reason I did this is that I wanted the bundle to be easily accessible via script tags, and rollup says that the iife format does this. This is the modified rollup.config.js file. // ========