sreenaths / vue3-webcomponent-wrapper-demo

Demo app for vue3-webcomponent-wrapper
Apache License 2.0
3 stars 4 forks source link

How to add vue-x, vue-router, ...? #2

Open thiensubs opened 3 years ago

thiensubs commented 3 years ago

Dear @sreenaths ,

How can i add vue-x, vue-router to adapted with this library ?

My example code:


import {
    createApp,
    h
} from 'vue'
import App from '~/App.vue';
import 'tui-image-editor/dist/tui-image-editor.css';
import 'pace-js/themes/red/pace-theme-flash.css'
import PDFPage from '~/components/PDFPage.vue';
import router from '~/components/vue-route-app';

const app = createApp(App)
app.config.isCustomElement = (tag) => tag === 'pdf-page';
app.use(router)
app.component('pdf-page', PDFPage)
// app.mount('#app')
import wrapper from "vue3-webcomponent-wrapper";
const webComponent = wrapper(app, createApp, h);
window.customElements.define('my-element', webComponent)
sreenaths commented 3 years ago

This must help I guess https://github.com/vuejs/vue-web-component-wrapper/issues/93#issuecomment-820408466

thiensubs commented 3 years ago

How I integrated this library and want to export all components inside the iFrame?