I have project with nested custom elements. Now I need to vuex & vue router. How I can use this packages from root custom element and then use in all child custom elements?
Currently I tried only use vuex inside each component like this:
<script>
import store from './store';
export default {
setup() {
const state = store.state;
return { state };
},
};
</script>
Here is demo project with nested custom elements
Here is my main.js file code:
import { defineCustomElement } from "./defineCustomElementWithStyles";
import App from "./App.ce.vue";
customElements.define("app-root", defineCustomElement(App));