This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/vuetify/lib/mixins/groupable/index.js

57 lines
1.1 KiB
JavaScript
Raw Normal View History

2019-08-11 18:48:02 +00:00
// Mixins
import { inject as RegistrableInject } from '../registrable';
export function factory(namespace, child, parent) {
// TODO: ts 3.4 broke directly returning this
const R = RegistrableInject(namespace, child, parent).extend({
name: 'groupable',
props: {
activeClass: {
type: String,
default() {
if (!this[namespace]) return undefined;
return this[namespace].activeClass;
}
},
disabled: Boolean
},
data() {
return {
isActive: false
};
},
computed: {
groupClasses() {
if (!this.activeClass) return {};
return {
[this.activeClass]: this.isActive
};
}
},
created() {
this[namespace] && this[namespace].register(this);
},
beforeDestroy() {
this[namespace] && this[namespace].unregister(this);
},
methods: {
toggle() {
this.$emit('change');
}
}
});
return R;
}
/* eslint-disable-next-line no-redeclare */
const Groupable = factory('itemGroup');
export default Groupable;
//# sourceMappingURL=index.js.map