When using a component in a vue context and a custom-element context – the styles in the vue context stop working, although they work fine for custom-element, is there a way to make the component styles work in both contexts?
webpack config:
module: {
rules: [
{
test: /.vue$/,
loader: 'vue-loader',
options: {
shadowMode: true
}
},
{
test: /.scss$/,
include: path.resolve(__dirname, 'js/components'),
use: [
{
loader: 'vue-style-loader',
options: {
shadowMode: true
}
},
]
},
]
},
declaration custom element:
import '@webcomponents/custom-elements';
import Vue from "vue";
import wrap from "@vue/web-component-wrapper"
import Element from "../components/Element.vue";
const _Element = wrap(Vue, Element)
window.customElements.define('element-select', _Element);