vue-web-component-wrapper
Version:
A Vue 3 plugin that provides a web component wrapper with styles, seamlessly integrating with Vuex, Vue Router, Vue I18n, and supporting Tailwind CSS and Sass styles.
33 lines (27 loc) • 926 B
TypeScript
import { Component, App } from 'vue'
interface Plugin {
install: (app: App) => void
}
export interface CreateWebComponentOptions {
elementName: string
rootComponent: Component
plugins?: Plugin
cssFrameworkStyles?: string
VueDefineCustomElement: (...args: any[]) => any
h: (...args: any[]) => any
getCurrentInstance: (...args: any[]) => any
createApp: (...args: any[]) => any
disableRemoveStylesOnUnmount?: boolean
disableShadowDOM?: boolean
replaceRootWithHostInCssFramework?: boolean
asyncInitialization?: () => Promise<any>
loaderAttribute?: string
hideSlotContentUntilMounted?: boolean
nonce?: string
}
export function createWebComponent(options: CreateWebComponentOptions): void
export default createWebComponent
interface defineCustomElementSFCOptions {
shadowRoot: boolean
}
export function defineCustomElementSFC(component: Component, options: defineCustomElementSFCOptions): any