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/proxyable/index.js

47 lines
832 B
JavaScript
Raw Permalink Normal View History

2019-08-11 18:48:02 +00:00
import Vue from 'vue';
export function factory(prop = 'value', event = 'change') {
return Vue.extend({
name: 'proxyable',
model: {
prop,
event
},
props: {
[prop]: {
required: false
}
},
data() {
return {
internalLazyValue: this[prop]
};
},
computed: {
internalValue: {
get() {
return this.internalLazyValue;
},
set(val) {
if (val === this.internalLazyValue) return;
this.internalLazyValue = val;
this.$emit(event, val);
}
}
},
watch: {
[prop](val) {
this.internalLazyValue = val;
}
}
});
}
/* eslint-disable-next-line no-redeclare */
const Proxyable = factory();
export default Proxyable;
//# sourceMappingURL=index.js.map