mirror of
https://github.com/Hopiu/vue-material.git
synced 2026-04-02 06:10:36 +00:00
Fixes register single theme #3
This commit is contained in:
parent
2b75318681
commit
ebdb7e2cb2
1 changed files with 6 additions and 15 deletions
|
|
@ -137,26 +137,17 @@ const registerDirective = (element, { value, oldValue }) => {
|
|||
|
||||
export default function install(Vue) {
|
||||
Vue.directive('mdTheme', registerDirective);
|
||||
|
||||
Vue.material.theme = {
|
||||
register(name, theme) {
|
||||
let currentThemes = Vue.material.theme.registeredThemes;
|
||||
register(name, spec) {
|
||||
let theme = {};
|
||||
|
||||
currentThemes[name] = theme;
|
||||
theme[name] = spec;
|
||||
|
||||
Vue.material.theme.registeredThemes = currentThemes;
|
||||
registerAllThemes(theme, Vue.material.styles);
|
||||
},
|
||||
registerAll(themes) {
|
||||
Vue.material.theme.registeredThemes = themes;
|
||||
}
|
||||
};
|
||||
|
||||
Object.defineProperty(Vue.material.theme, 'registeredThemes', {
|
||||
get() {
|
||||
return this.themes;
|
||||
},
|
||||
set(themes) {
|
||||
this.themes = themes;
|
||||
registerAllThemes(themes, Vue.material.styles);
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue