mirror of
https://github.com/digitalocean/nginxconfig.io.git
synced 2025-08-08 19:07:44 +08:00
Add computed default for path
This commit is contained in:
@@ -159,6 +159,7 @@ THE SOFTWARE.
|
|||||||
},
|
},
|
||||||
path: {
|
path: {
|
||||||
default: '',
|
default: '',
|
||||||
|
computed: '/var/www/example.com', // No default value, but a default computed
|
||||||
enabled: true,
|
enabled: true,
|
||||||
},
|
},
|
||||||
documentRoot: {
|
documentRoot: {
|
||||||
@@ -223,6 +224,11 @@ THE SOFTWARE.
|
|||||||
if (!data.computed.trim()) {
|
if (!data.computed.trim()) {
|
||||||
data.computed = data.default;
|
data.computed = data.default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure there is a default path
|
||||||
|
if (!this.$props.data.path.value.trim()) {
|
||||||
|
this.$props.data.path.computed = `/var/www/${data.computed}`;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
deep: true,
|
deep: true,
|
||||||
},
|
},
|
||||||
@@ -240,6 +246,15 @@ THE SOFTWARE.
|
|||||||
},
|
},
|
||||||
deep: true,
|
deep: true,
|
||||||
},
|
},
|
||||||
|
// Ensure there is a default path
|
||||||
|
'$props.data.path': {
|
||||||
|
handler(data) {
|
||||||
|
if (!data.computed.trim()) {
|
||||||
|
data.computed = `/var/www/${this.$props.data.domain.computed}`;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deep: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
Reference in New Issue
Block a user