mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-22 07:19:41 +00:00
feat: expose Vue globally for external extension widgets
This commit is contained in:
@@ -12,6 +12,10 @@ import { createApp } from 'vue'
|
||||
import { VueFire, VueFireAuth } from 'vuefire'
|
||||
|
||||
import { getFirebaseConfig } from '@/config/firebase'
|
||||
import { exposeVueApi } from '@/utils/vueExtensionApi'
|
||||
|
||||
// Expose Vue utilities for external extensions before they load
|
||||
exposeVueApi()
|
||||
import '@/lib/litegraph/public/css/litegraph.css'
|
||||
import router from '@/router'
|
||||
|
||||
|
||||
19
src/utils/vueExtensionApi.ts
Normal file
19
src/utils/vueExtensionApi.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Exposes Vue for external extensions to create Vue components.
|
||||
*
|
||||
* Usage in extensions:
|
||||
* ```js
|
||||
* const { h, defineComponent, ref, computed } = window.Vue
|
||||
* ```
|
||||
*/
|
||||
import * as Vue from 'vue'
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
Vue: typeof Vue
|
||||
}
|
||||
}
|
||||
|
||||
export function exposeVueApi(): void {
|
||||
window.Vue = Vue
|
||||
}
|
||||
Reference in New Issue
Block a user