mirror of
https://github.com/creativetimofficial/vue-material-kit.git
synced 2025-07-05 12:14:21 +08:00
25 lines
467 B
JavaScript
25 lines
467 B
JavaScript
/**
|
|
* You can register global mixins here
|
|
*/
|
|
|
|
const GlobalMixins = {
|
|
install(Vue) {
|
|
Vue.mixin({
|
|
mounted() {
|
|
let { bodyClass } = this.$options;
|
|
if (bodyClass) {
|
|
document.body.classList.add(bodyClass);
|
|
}
|
|
},
|
|
beforeDestroy() {
|
|
let { bodyClass } = this.$options;
|
|
if (bodyClass) {
|
|
document.body.classList.remove(bodyClass);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
};
|
|
|
|
export default GlobalMixins;
|