win-eternal-ui
Version:
A Component Library for Vue 3(仅供测试,别下载)
16 lines (12 loc) • 362 B
text/typescript
import type { App, Plugin } from 'vue'
const INSTALLED_KEY = Symbol('INSTALLED_KEY')
export function makeInstaller(components: Plugin[] = []) {
const install = (app: App) => {
if ((app as any)[INSTALLED_KEY]) return
; (app as any)[INSTALLED_KEY] = true
components.forEach(comp => app.use(comp))
}
return {
install
}
}