TextInputTab.vue 714 Bytes
Newer Older
1
2
3
4
5
6
7
8
<template>
  <v-textarea
    @input="updateValue()"
    hide-details
    outlined
    height=8em
    auto-grow
    clearable
Quentin David's avatar
Quentin David committed
9
10
    v-model="textInput"
    :label="$t('text-input')"
11
12
13
14
15
  ></v-textarea>
</template>
<script>
export default {
  data: () => ({
Quentin David's avatar
Quentin David committed
16
      textInput: ''
17
18
19
20
21
  }),
  props: ['isSelectedTab'],
  watch: {
    isSelectedTab: function() {
      if (!this.isSelectedTab) {
Quentin David's avatar
Quentin David committed
22
        this.textInput = '';
23
24
25
26
27
28
        this.updateValue();
      }
    }
  },
  methods: {
    updateValue: function() {
Quentin David's avatar
Quentin David committed
29
      this.$emit('text-input-update', this.textInput);
30
31
32
33
34
35
36
    }
  }
}
</script>
<i18n>
{
  "fr":{
Quentin David's avatar
Quentin David committed
37
    "text-input":"Entrez ou collez votre texte ici"
38
39
  },
  "en":{
Quentin David's avatar
Quentin David committed
40
    "text-input":"Type or paste your text here"
41
42
  }
}