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

37 lines
627 B
JavaScript
Raw Normal View History

2019-08-11 18:48:02 +00:00
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