diff --git a/frontend/src/main.js b/frontend/src/main.js index 5cc12ed2..a275c9bd 100644 --- a/frontend/src/main.js +++ b/frontend/src/main.js @@ -5,11 +5,34 @@ import router from './router' import App from './App.vue' import { createPinia } from 'pinia' -import { FrappeUI, Button, setConfig, frappeRequest } from 'frappe-ui' +import { + FrappeUI, + Button, + Input, + TextInput, + FormControl, + ErrorMessage, + Dialog, + Alert, + Badge, + setConfig, + frappeRequest, +} from 'frappe-ui' import socket from './socket' import { getCachedListResource } from 'frappe-ui/src/resources/listResource' import { getCachedResource } from 'frappe-ui/src/resources/resources' +let globalComponents = { + Button, + TextInput, + Input, + FormControl, + ErrorMessage, + Dialog, + Alert, + Badge, +} + // create a pinia instance let pinia = createPinia() @@ -19,8 +42,10 @@ setConfig('resourceFetcher', frappeRequest) app.use(FrappeUI) app.use(pinia) app.use(router) +for (let key in globalComponents) { + app.component(key, globalComponents[key]) +} -app.component('Button', Button) app.mount('#app') socket.on('refetch_resource', (data) => {