Newer
Older
<article v-show="article.lemmas.length">
<section v-if="article.body.pronunciation.length">
<DefElement v-for="(element, index) in article.body.pronunciation" :key="index" :body='element' @article-click="article_link_click" />
</section>
<section v-if="article.body.etymology">
<DefElement v-for="(element, index) in article.body.etymology" :key="index" :body='element' @article-click="article_link_click" />
</section>
<section>
<Definition v-for="definition in definitions" :key="definition.id" :body='definition' @article-click="article_link_click" />
</section>
</article>
import Definition from './Definition.vue'

Ole Voldsæter
committed
},
computed: {
definitions: function() {
let defs = this.article.body.definitions
if (defs.length == 1) {
let types = defs[0].elements.reduce((acc, toAdd)=>acc.add(toAdd.type_), new Set())
if (types.size == 1 && types.has('definition')) {
return defs[0].elements
}
}
return defs
}
},
methods: {
article_link_click: function(item) {
this.$emit('article-click', item)
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
//color: #42b983;
}
ol > li {
padding-bottom: 2em;
}
ol > li:only-child {
list-style: none;
}
ol > li:only-child > ul {
padding-left: 0px;
}
ul {
padding-top: 8px;
}
ul li {
list-style:none;
}
li ul .definition ul {
}
ul li.definition {
list-style: disc;