ftt-ui-components
Version:
some components for vuetify3/element-plus/... with vue3.
24 lines (17 loc) • 570 B
text/typescript
import { App, Plugin } from 'vue'
import GlButton from './button'
import { GlMessage } from './message'
const components = [GlButton]
const plugins = [GlMessage]
const INSTALLED_KEY = Symbol('INSTALLED_KEY')
function makeInstaller(components: Plugin[] = []) {
const install = (app: App) => {
if ((app as any)[INSTALLED_KEY]) return
;(app as any)[INSTALLED_KEY] = true
components.forEach((c) => app.use(c))
}
return { install }
}
const installer = makeInstaller([...components, ...plugins])
export { GlMessage, GlButton }
export default installer