Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

Convert to composition API

天舟8b2deba06fc2
diff --git a/frontend/src/components/EnvironmentForm.vue b/frontend/src/components/EnvironmentForm.vue
index 5d9af31ad2..deb8a0964c 100644
--- a/frontend/src/components/EnvironmentForm.vue
+++ b/frontend/src/components/EnvironmentForm.vue
@@ -112,20 +112,22 @@ export default {
return !isEqual(props.environment, state.environment);
});
+ const updateEnvironment = (field: string, value: string) => {
+ if (state.environment) {
+ (state.environment as any)[field] = value;
+ }
+ };
+
+ const revertEnvironment = () => {
+ state.environment = cloneDeep(props.environment);
+ };
+
return {
state,
valueChanged,
+ updateEnvironment,
+ revertEnvironment,
};
},
- methods: {
- updateEnvironment: function (field: string, value: string) {
- if (this.state.environment) {
- (this.state.environment as any)[field] = value;
- }
- },
- revertEnvironment: function () {
- this.state.environment = cloneDeep(this.$props.environment);
- },
- },
};
</script>