From 97b28323c584909b778d8ab7a0ae541e190ed39a Mon Sep 17 00:00:00 2001 From: MattIPv4 Date: Tue, 28 Apr 2020 18:55:15 +0100 Subject: [PATCH] Watching the parent seems to work better --- .../templates/domain_sections/php.vue | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/nginxconfig/templates/domain_sections/php.vue b/src/nginxconfig/templates/domain_sections/php.vue index b835351..a0234d6 100644 --- a/src/nginxconfig/templates/domain_sections/php.vue +++ b/src/nginxconfig/templates/domain_sections/php.vue @@ -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, }, }, };