Skip to content

Commit

Permalink
fix: try to import only needed buefy components
Browse files Browse the repository at this point in the history
  • Loading branch information
feerglas committed Oct 20, 2020
1 parent ed09c17 commit 14f1674
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 19 deletions.
40 changes: 40 additions & 0 deletions src/customBuefy.js
Original file line number Diff line number Diff line change
@@ -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;
21 changes: 2 additions & 19 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -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 <html> attributes
/* eslint-disable no-param-reassign */
Expand All @@ -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));
Expand Down

0 comments on commit 14f1674

Please sign in to comment.