common-setup.ts
1 import type { App } from 'vue' 2 import 'vuetify/styles' 3 import { type ThemeDefinition, createVuetify } from 'vuetify' 4 import * as components from 'vuetify/components' 5 import * as directives from 'vuetify/directives' 6 import * as labsComponents from 'vuetify/labs/components' 7 import { aliases, mdi } from 'vuetify/iconsets/mdi' 8 import { fa } from 'vuetify/iconsets/fa' 9 10 const vuetify = createVuetify({ 11 icons: { 12 defaultSet: 'mdi', 13 aliases, 14 sets: { 15 mdi, 16 fa, 17 }, 18 }, 19 components: { 20 ...components, 21 ...labsComponents, 22 }, 23 directives, 24 theme: { 25 // defaultTheme: 'CommodoreWarmTheme', 26 // themes: { 27 // CommodoreWarmTheme, 28 // }, 29 // 30 }, 31 }) 32 33 export function setupApp(app: App) { 34 // Inject a globally available `$app` object in template 35 app.config.globalProperties.$app = { 36 context: '', 37 } 38 39 // Provide access to `app` in script setup with `const app = inject('app')` 40 app.provide('app', app.config.globalProperties.$app) 41 42 // Here you can install additional plugins for all contexts: popup, options page and content-script. 43 // example: app.use(i18n) 44 // example excluding content-script context: if (context !== 'content-script') app.use(i18n) 45 app.use(vuetify) 46 }