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/toggleable/index.js
2019-08-11 20:48:02 +02:00

37 lines
No EOL
627 B
JavaScript

import Vue from 'vue';
export function factory(prop = 'value', event = 'input') {
return Vue.extend({
name: 'toggleable',
model: {
prop,
event
},
props: {
[prop]: {
required: false
}
},
data() {
return {
isActive: !!this[prop]
};
},
watch: {
[prop](val) {
this.isActive = !!val;
},
isActive(val) {
!!val !== this[prop] && this.$emit(event, val);
}
}
});
}
/* eslint-disable-next-line no-redeclare */
const Toggleable = factory();
export default Toggleable;
//# sourceMappingURL=index.js.map