16 lines
338 B
TypeScript
Raw Permalink Normal View History

2024-11-05 10:09:18 +08:00
import { INSTALLED_KEY } from '../constants'
import type { App, Plugin } from '@vue/runtime-core'
export const makeInstaller = (components: Plugin[] = []) => {
const install = (app: App) => {
if (app[INSTALLED_KEY]) return
app[INSTALLED_KEY] = true
components.forEach((c) => app.use(c))
}
return {
install,
}
}