mount vue(3.x)
App in shadowDom
Vue 3.5 has good support build vue in CustomElement mode, which is base on shadow dom. While if you dont want use the isolation ability without using custom element (eg. custom element is unavailable in chrome extension sandbox environment), try this library.
It acts just like createApp
in vue
And the 3rd parameter allows you to ship global styles like vue.defineCustomElement.
import { createShadowApp } from 'vue-create-shadow-app'
const app = createShadowApp(
App,
{
someProp: 'someValue',
},
{
styles: [elementStyle, ...App.styles],
},
)
app.use(ElementPlus)