1234567891011121314151617181920212223 |
- import { provideGlobalConfig } from '@kankan-components/hooks'
- // import { INSTALLED_KEY } from '@kankan-components/constants'
- import { version } from './version'
- import type { App, Plugin } from '@vue/runtime-core'
- import type { ConfigProviderContext } from '@kankan-components/tokens'
- const INSTALLED_KEY = Symbol('INSTALLED_KEY')
- export const makeInstaller = (components: Plugin[] = []) => {
- const install = (app: App, options?: ConfigProviderContext) => {
- if (app[INSTALLED_KEY]) return
- app[INSTALLED_KEY] = true
- components.forEach(c => app.use(c))
- if (options) provideGlobalConfig(options, app, true)
- }
- return {
- version,
- install,
- }
- }
|