Appearance
Demo
https://stackblitz.com/~/github.com/EranGrin/vuetify-web-component-wrapper
Usage
- Install Vuetify:bashor
npm install vuetify
bashyarn add vuetify
- Create the vutify plugin configuration file:javascript
// Styles import '@mdi/font/css/materialdesignicons.css' import 'vuetify/styles' // Composables import { createVuetify } from 'vuetify' export default createVuetify({ theme: { defaultTheme: 'dark', }, })
- Add the plugin to the plugins warpper:javascript
import vuetify from './vuetify' export const pluginsWrapper = { install(GivenVue: any) { const Vue = GivenVue Vue.use(vuetify) } }
- Create style.css file:cssyou can add any global css to this file
@import 'vuetify/dist/vuetify.min.css';
- Import the style.css file with ?inline:javascript
import style from './style.css?inline';
- Create your web component passing the style variable as the cssFrameworkStyles option:javascript
createWebComponent({ rootComponent: App, elementName: 'my-web-component', plugins: pluginsWrapper, cssFrameworkStyles: style, VueDefineCustomElement, h, createApp, getCurrentInstance, disableStyleRemoval: false, });