Files
scrypted/plugins/core/ui/src/common/CustomValue.vue
Koushik Dutta a46b2811ed initial commit
2021-08-24 21:22:41 -07:00

28 lines
479 B
Vue

<script>
import cloneDeep from "lodash/cloneDeep";
export default {
props: ["value"],
data() {
return {
lazyValue: this.createLazyValue()
};
},
methods: {
createLazyValue() {
return cloneDeep(this.value);
},
createInputValue() {
return this.lazyValue;
},
onInput() {
this.$emit("input", this.createInputValue());
}
},
watch: {
value() {
this.lazyValue = this.createLazyValue();
}
}
};
</script>