feat: introducing self hosted admin dashboard package (#12)
Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com> Co-authored-by: Anwarul Islam <anwaarulislaam@gmail.com>
This commit is contained in:
committed by
GitHub
parent
2ba05a46ee
commit
3f59597864
30
packages/hoppscotch-ui/src/plugin.ts
Normal file
30
packages/hoppscotch-ui/src/plugin.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import type { Plugin, App } from "vue"
|
||||
|
||||
import "./assets/scss/styles.scss"
|
||||
import "virtual:windi.css"
|
||||
|
||||
/**
|
||||
@constant HOPP_UI_OPTIONS
|
||||
A constant representing the key for storing HoppUI plugin options in the global context.
|
||||
*/
|
||||
|
||||
export const HOPP_UI_OPTIONS = "HOPP_UI_OPTIONS"
|
||||
|
||||
/**
|
||||
@typedef {Object} HoppUIPluginOptions
|
||||
@property [t] - A function for handling translations for the plugin.
|
||||
@property [onModalOpen] - A callback function that is called when a modal is opened.
|
||||
@property [onModalClose] - A callback function that is called when a modal is closed.
|
||||
*/
|
||||
|
||||
export type HoppUIPluginOptions = {
|
||||
t?: (key: string) => string
|
||||
onModalOpen?: () => void
|
||||
onModalClose?: () => void
|
||||
}
|
||||
|
||||
export const plugin: Plugin = {
|
||||
install(app: App, options: HoppUIPluginOptions = {}) {
|
||||
app.provide(HOPP_UI_OPTIONS, options)
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user