fix: added some of frappe-ui components as global components
This commit is contained in:
parent
a68716c26e
commit
c614a90e16
@ -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) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user