mirror of
https://github.com/Hopiu/vue-material.git
synced 2026-04-22 15:44:49 +00:00
Add enable all function to register components
This commit is contained in:
parent
6c9f718145
commit
2d08caf2d0
2 changed files with 23 additions and 17 deletions
|
|
@ -1,20 +1,16 @@
|
|||
import Vue from 'vue';
|
||||
import VueMaterial from '../vue-material';
|
||||
|
||||
for (let component in VueMaterial) {
|
||||
if (component === 'MdTheme') {
|
||||
Vue.use(VueMaterial[component], {
|
||||
default: {
|
||||
primary: {
|
||||
color: 'green',
|
||||
hue: 800
|
||||
}
|
||||
},
|
||||
'bottom-bar': {
|
||||
primary: 'teal'
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Vue.use(VueMaterial[component]);
|
||||
VueMaterial.enableAll(Vue);
|
||||
|
||||
Vue.use(VueMaterial.MdTheme, {
|
||||
default: {
|
||||
primary: {
|
||||
color: 'green',
|
||||
hue: 800
|
||||
}
|
||||
},
|
||||
'bottom-bar': {
|
||||
primary: 'teal'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import MdAvatar from './components/mdAvatar';
|
|||
import MdList from './components/mdList';
|
||||
import MdWhiteframe from './components/mdWhiteframe';
|
||||
|
||||
export default {
|
||||
let options = {
|
||||
MdAvatar,
|
||||
MdBottomBar,
|
||||
MdButton,
|
||||
|
|
@ -24,3 +24,13 @@ export default {
|
|||
MdWhiteframe,
|
||||
MdTheme
|
||||
};
|
||||
|
||||
options.enableAll = (Vue) => {
|
||||
for (let component in options) {
|
||||
if (component !== 'MdTheme' && component !== 'enableAll') {
|
||||
Vue.use(options[component]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default options;
|
||||
|
|
|
|||
Loading…
Reference in a new issue