summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/monitoring/components/variables/text_variable.vue
blob: ce0d19760e2c73a9c81a4dd3caf6cb50e5c7a773 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<script>
import { GlFormGroup, GlFormInput } from '@gitlab/ui';

export default {
  components: {
    GlFormGroup,
    GlFormInput,
  },
  props: {
    name: {
      type: String,
      required: true,
    },
    label: {
      type: String,
      required: true,
    },
    value: {
      type: String,
      required: true,
    },
  },
  methods: {
    onUpdate(event) {
      this.$emit('onUpdate', this.name, event.target.value);
    },
  },
};
</script>
<template>
  <gl-form-group :label="label">
    <gl-form-input
      :value="value"
      :name="name"
      @keyup.native.enter="onUpdate"
      @blur.native="onUpdate"
    />
  </gl-form-group>
</template>