Stencil version:
I'm submitting a:
[x] bug report
[ ] feature request
[ ] support request
Current behavior:
When integrating a web component generated by Stencil JS into Vue or React framework according to Stencil JS docs then the web component polyfill is not working at all.
Expected behavior:
Stencil Web Component polyfill should work correctly when integrating in e.g. Vue or React framework.
Steps to reproduce:
Create project setup
Add a package.json file:
{
"name": "test",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"private": true,
"workspaces": ["test-components", "test-app"]
}
Setup Stencil JS
Make sure to execute the following command within the previously generated folder test.
Selected options:
cd test-components
npm install @stencil/core@1.0.3
Edit following file:
src/components/my-component/my-component.css
div {
background: deeppink;
}
Create a build
Setup Vue JS
Using Vue cli (version: 3.8.2) to create a dummy Vue project.
Make sure to execute the following command within the previously generated folder test.
Selected options:
Adapt test-app/src/main.ts
import Vue from 'vue';
import App from './App.vue';
import { defineCustomElements } from 'test-components/loader';
Vue.config.productionTip = false;
Vue.config.ignoredElements = [/my-\w*/];
defineCustomElements(window);
new Vue({
render: (h) => h(App),
}).$mount('#app');
Adapt template section in test-app/src/App.vue
<template>
<div id="app">
<img alt="Vue logo" src="./assets/logo.png">
<my-component first="Stencil" last="'Don't call me a framework' JS"></my-component>
<HelloWorld msg="Welcome to Your Vue.js + TypeScript App"/>
</div>
</template>
Start application
Web component is working fine in e.g. latest version of Chrome but component is not shown in e.g. IE11.
Stencil version:
I'm submitting a:
[x] bug report
[ ] feature request
[ ] support request
Current behavior:
When integrating a web component generated by Stencil JS into Vue or React framework according to Stencil JS docs then the web component polyfill is not working at all.
Expected behavior:
Stencil Web Component polyfill should work correctly when integrating in e.g. Vue or React framework.
Steps to reproduce:
Create project setup
Add a package.json file:
Setup Stencil JS
Make sure to execute the following command within the previously generated folder
test.Selected options:
Edit following file:
src/components/my-component/my-component.css
Create a build
Setup Vue JS
Using Vue cli (version: 3.8.2) to create a dummy Vue project.
Make sure to execute the following command within the previously generated folder
test.Selected options:
Adapt
test-app/src/main.tsAdapt template section in
test-app/src/App.vueStart application
Web component is working fine in e.g. latest version of Chrome but component is not shown in e.g. IE11.