mirror of
https://github.com/koush/scrypted.git
synced 2026-02-18 20:42:40 +00:00
28 lines
479 B
Vue
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> |