Skip to content
Snippets Groups Projects
Header.vue 1.84 KiB
Newer Older
<template>
    <h1 class="article_header" v-for="(lemma, index) in lemmas" :key="index">
      {{lemma.lemma}}{{index+1 < lemmas.length ? ',' : ''}} </h1>
      <details title="Klikk for å se bøyninger">
        <summary>{{group_list}}</summary>
        <div class="inflection">
          <div v-for="(lemma, index) in lemmas" :key="index">
            <h4>{{lemma.lemma}}</h4>
            <table v-for="(std, index) in lemma.paradigm_info"  :key="index">
              <tr>
                <th rowspan="2">{{std.tags ? std.tags.join(', ') : ''}}</th>
                <th v-for="(inflection, index) in std.inflection"  :key="index">{{inflection.tags.join(', ')}}</th>
              </tr>
              <tr>
                <td v-for="(inflection, index) in std.inflection"  :key="index">{{inflection.word_form}}</td>
              </tr>
            </table>
          </div>
        </div>
      </details>
  </div>
</template>

<script>
Ole Voldsæter's avatar
Ole Voldsæter committed
import helpers from '../utils/helpers.js'

export default {
  name: 'Header',
  props: {
    lemmas: Array
  },
  computed: {
    group_list: function() {
Ole Voldsæter's avatar
Ole Voldsæter committed
      return helpers.group_list(this.lemmas)
    }
  },
  components: {
  }
}
</script>

Ole Voldsæter's avatar
Ole Voldsæter committed

.word-classification {
  text-decoration: underline dashed;
}

  display: inline;
}

  border-collapse: collapse;
  margin: 10px;
}

.inflection td, .inflection th {
  border: solid;
  border-width: 1px;
  margin: 0px 0px 0px 0px;
  padding: 3px;
}

details > summary {
  padding: 2px 6px;
  width: 15em;
  border: none;
  cursor: help;
  list-style: none;
  text-decoration: underline;
  text-decoration-style: dashed;
}

details > summary::-webkit-details-marker {
  display: none;
}

details > div {
  border-radius: 0 0 10px 10px;
  background-color: #eee;
  padding: 2px 6px;
  margin: 0;
  box-shadow: 3px 3px 4px black;
}

</style>