mirror of
https://github.com/digitalocean/nginxconfig.io.git
synced 2025-08-11 06:21:49 +08:00
Move presets into their own panel
This commit is contained in:
@@ -1,12 +1,20 @@
|
||||
import isChanged from './is_changed';
|
||||
|
||||
export default (defaults, cat) => {
|
||||
export default (defaults, cat, isInteraction = true) => {
|
||||
return Object.keys(defaults).reduce((prev, key) => {
|
||||
prev[key] = {
|
||||
get() {
|
||||
return this.$props.data[key].value;
|
||||
},
|
||||
set (value) {
|
||||
// Save user interaction if value changed
|
||||
if (isInteraction
|
||||
&& this.$parent
|
||||
&& 'hasUserInteraction' in this.$parent.$data
|
||||
&& !this.$parent.$data.hasUserInteraction
|
||||
&& this.$props.data[key].value !== value)
|
||||
this.$parent.$data.hasUserInteraction = true;
|
||||
|
||||
this.$props.data[key].value = value;
|
||||
this.$props.data[key].computed = value;
|
||||
},
|
||||
|
Reference in New Issue
Block a user