Import global components using index.js

This commit is contained in:
Bubka 2020-01-15 21:04:30 +01:00
parent 38288332c5
commit 767daf0565
2 changed files with 10 additions and 2 deletions

3
resources/js/app.js vendored
View File

@ -15,8 +15,8 @@ import Edit from './views/Edit'
import PasswordRequest from './views/auth/password/Request'
import PasswordReset from './views/auth/password/Reset'
import NotFound from './views/Error'
import Button from './components/Button'
import './components'
import { library } from '@fortawesome/fontawesome-svg-core'
import { faPlus, faQrcode, faImage, faTrash, faEdit, faCheck, faLock, faLockOpen, faSearch } from '@fortawesome/free-solid-svg-icons'
@ -25,7 +25,6 @@ import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
library.add(faPlus, faQrcode, faImage, faTrash, faEdit, faCheck, faLock, faLockOpen, faSearch);
Vue.component('font-awesome-icon', FontAwesomeIcon)
Vue.component('VButton', Button)
// const lang = document.documentElement.lang.substr(0, 2);
const lang = 'en';

9
resources/js/components/index.js vendored Normal file
View File

@ -0,0 +1,9 @@
import Vue from 'vue'
import Button from './Button'
// Components that are registered globaly.
[
Button,
].forEach(Component => {
Vue.component(Component.name, Component)
})