description.vue 1.29 KB
Newer Older
1
<script>
2
  import updateMixin from '../../mixins/update';
3 4 5
  import markdownField from '../../../vue_shared/components/markdown/field.vue';

  export default {
6
    mixins: [updateMixin],
7
    props: {
8
      formState: {
9 10 11
        type: Object,
        required: true,
      },
12
      markdownPreviewPath: {
13 14 15
        type: String,
        required: true,
      },
16
      markdownDocsPath: {
Phil Hughes's avatar
Phil Hughes committed
17 18 19
        type: String,
        required: true,
      },
20 21 22 23
    },
    components: {
      markdownField,
    },
24 25 26
    mounted() {
      this.$refs.textarea.focus();
    },
27 28 29 30
  };
</script>

<template>
31
  <div class="common-note-form">
32 33 34
    <label
      class="sr-only"
      for="issue-description">
35 36
      Description
    </label>
37
    <markdown-field
38 39
      :markdown-preview-path="markdownPreviewPath"
      :markdown-docs-path="markdownDocsPath">
40
      <textarea
41
        id="issue-description"
42
        class="note-textarea js-gfm-input js-autosize markdown-area"
43
        data-supports-quick-actionss="false"
44
        aria-label="Description"
45
        v-model="formState.description"
46
        ref="textarea"
47
        slot="textarea"
48
        placeholder="Write a comment or drag your files here..."
49 50
        @keydown.meta.enter="updateIssuable"
        @keydown.ctrl.enter="updateIssuable">
51 52 53 54
      </textarea>
    </markdown-field>
  </div>
</template>