mirror of
https://github.com/digitalocean/nginxconfig.io
synced 2024-11-10 12:34:12 +00:00
Watching the parent seems to work better
This commit is contained in:
parent
27ad3cbea2
commit
97b28323c5
1 changed files with 13 additions and 13 deletions
|
@ -42,19 +42,19 @@
|
|||
computed: computedFromDefaults(defaults), // Getters & setters for the delegated data
|
||||
watch: {
|
||||
// If the Reverse proxy is enabled, PHP will be forced off
|
||||
'$parent.$props.data.reverseProxy.reverseProxy.computed'() { this.checkPhpEnabled(); },
|
||||
php() { this.checkPhpEnabled(); },
|
||||
},
|
||||
methods: {
|
||||
checkPhpEnabled() {
|
||||
const state = this.$parent.$props.data.reverseProxy.reverseProxy.computed;
|
||||
if (state) {
|
||||
this.$props.data.php.enabled = false;
|
||||
this.$props.data.php.computed = false;
|
||||
} else {
|
||||
this.$props.data.php.enabled = true;
|
||||
this.$props.data.php.computed = this.$props.data.php.value;
|
||||
}
|
||||
'$parent.$props.data': {
|
||||
handler(data) {
|
||||
// This might cause recursion, but seems not to
|
||||
const state = data.reverseProxy.reverseProxy.computed;
|
||||
if (state) {
|
||||
this.$props.data.php.enabled = false;
|
||||
this.$props.data.php.computed = false;
|
||||
} else {
|
||||
this.$props.data.php.enabled = true;
|
||||
this.$props.data.php.computed = this.$props.data.php.value;
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue