feat: add global register

This commit is contained in:
2023-03-10 22:18:22 +08:00
parent 1e19c7fac2
commit 6f22f963b4
4 changed files with 17 additions and 6 deletions

1
components/components.ts Normal file
View File

@ -0,0 +1 @@
export { default as Button } from './button'

View File

@ -1,7 +1,13 @@
export {}
import type { App } from 'vue'
import * as components from './components'
const aaa = () => {
// TODO
export default {
install(app: App) {
for (const componentsKey in components) {
const component = (components as any)[componentsKey]
if (component.install) {
app.use(component)
}
}
}
}
export default aaa