|
24 | 24 | </template> |
25 | 25 |
|
26 | 26 | <script setup> |
27 | | - const stepper_tree = inject("stepper_tree") |
| 27 | + const emit = defineEmits([ |
| 28 | + "update_values", |
| 29 | + "increment_current_step", |
| 30 | + "decrement_current_step", |
| 31 | + ]) |
| 32 | +
|
28 | 33 | const props = defineProps({ |
29 | 34 | input_geode_object: { type: String, required: true }, |
30 | | - variable_to_update: { type: String, required: true }, |
| 35 | + key_to_update: { type: String, required: true }, |
31 | 36 | schema: { type: Object, required: true }, |
32 | 37 | }) |
33 | 38 |
|
34 | | - const { input_geode_object, variable_to_update, schema } = props |
| 39 | + const { input_geode_object, key_to_update, schema } = props |
35 | 40 |
|
36 | 41 | const search = ref("") |
37 | 42 | const data_table_loading = ref(false) |
|
41 | 46 |
|
42 | 47 | watch(selected_crs, (new_value) => { |
43 | 48 | const crs = get_selected_crs(new_value[0]) |
44 | | - set_crs(crs) |
| 49 | + const keys_values_object = { |
| 50 | + [key_to_update]: crs, |
| 51 | + } |
| 52 | + emit("update_values", keys_values_object) |
| 53 | + emit("increment_current_step") |
45 | 54 | }) |
46 | 55 |
|
47 | | - function set_crs(crs_value) { |
48 | | - stepper_tree[variable_to_update] = crs_value |
49 | | - stepper_tree["current_step_index"]++ |
50 | | - } |
51 | | -
|
52 | 56 | function get_selected_crs(crs_code) { |
53 | 57 | for (let i = 0; i <= crs_list.value.length; i++) { |
54 | 58 | if (crs_list.value[i]["code"] == crs_code) { |
|
0 commit comments