mirror of
https://github.com/primedigitaltech/azon_seeker.git
synced 2026-01-19 13:13:22 +08:00
22 lines
658 B
TypeScript
22 lines
658 B
TypeScript
import type { App } from 'vue';
|
|
|
|
/**
|
|
* Setup Vue app
|
|
* @param app Vue app
|
|
*/
|
|
export function setupApp(app: App) {
|
|
const context = document.location.pathname.split('/')[2];
|
|
|
|
// Inject a globally available `$app` object in template
|
|
app.config.globalProperties.$app = {
|
|
context,
|
|
};
|
|
|
|
// Provide access to `app` in script setup with `const app = inject('app')`
|
|
app.provide('app', app.config.globalProperties.$app);
|
|
|
|
// Here you can install additional plugins for all contexts: popup, options page and content-script.
|
|
// example: app.use(i18n)
|
|
// example excluding content-script context: if (context !== 'content-script') app.use(i18n)
|
|
}
|