diff --git a/src/customBuefy.js b/src/customBuefy.js new file mode 100644 index 00000000..1086a384 --- /dev/null +++ b/src/customBuefy.js @@ -0,0 +1,40 @@ +import { + Checkbox, + Field, + Icon, + Select, + Table, + Tooltip +} from 'buefy/src/components'; +import config from 'buefy/src/utils/config'; +import VueFeatherIconPack from './components/VueFeatherIconPack.vue'; + +const MyBuefy = { + install(Vue) { + Vue.component('vue-feather-icon-pack', VueFeatherIconPack); + + config.customIconPacks = { + ft: { + iconPrefix: '', + sizes: { + 'default': '1.5x', + 'is-large': '3x', + 'is-medium': '2x', + 'is-small': '1x' + } + } + }; + + config.defaultIconComponent = 'vue-feather-icon-pack'; + config.defaultIconPack = 'ft'; + + Vue.use(Checkbox); + Vue.use(Field); + Vue.use(Icon); + Vue.use(Select); + Vue.use(Table); + Vue.use(Tooltip); + } +}; + +export default MyBuefy; diff --git a/src/main.js b/src/main.js index 22ac963c..9ce2a785 100644 --- a/src/main.js +++ b/src/main.js @@ -1,15 +1,13 @@ import './styles/bulma.scss'; -import Buefy from 'buefy'; +import CustomBuefy from './customBuefy'; import DefaultLayout from './layouts/Default.vue'; import extractLocale from './locales/extractLocale'; import locales from './locales/locales'; -import VueFeatherIconPack from './components/VueFeatherIconPack.vue'; export default (Vue, { head, appOptions }) => { - Vue.component('vue-feather-icon-pack', VueFeatherIconPack); // add attributes /* eslint-disable no-param-reassign */ @@ -26,22 +24,7 @@ export default (Vue, { name: 'width=device-width, initial-scale=1' }); - // Register Bulma - Vue.use(Buefy, { - customIconPacks: { - ft: { - iconPrefix: '', - sizes: { - 'default': '1.5x', - 'is-large': '3x', - 'is-medium': '2x', - 'is-small': '1x' - } - } - }, - defaultIconComponent: 'vue-feather-icon-pack', - defaultIconPack: 'ft' - }); + Vue.use(CustomBuefy); // Set Locales Messages appOptions.i18n.setLocaleMessage('de', extractLocale('de', locales));