Newer
Older
<article v-show="article.lemmas.length || article.error">
<Header :lemmas="article.lemmas" :dictionary="dictionary" :article_id="article.article_id" />
<section v-if="! article.error && article.body.pronunciation && article.body.pronunciation.length">
<DefElement v-for="(element, index) in article.body.pronunciation" :dictionary="dictionary" :key="index" :body='element' @article-click="article_link_click" />
<section v-if="! article.error && article.body.etymology && article.body.etymology.length">
<DefElement v-for="(element, index) in article.body.etymology" :dictionary="dictionary" :key="index" :body='element' @article-click="article_link_click" />
<Definition v-for="definition in article.body.definitions" :dictionary="dictionary" :level="1" :key="definition.id" :body='definition' @article-click="article_link_click" />
<section v-if="article.error">
<h1>Ooops...</h1>
<p>{{article.error}}</p>
</section>
import Definition from './Definition.vue'
computed: {
dictionary: function() {
return this.article.dictionary || this.$route.params.lang
}
},

Ole Voldsæter
committed
},
methods: {
article_link_click: function(item) {
this.$emit('article-click', item)
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
padding: 10px;
margin: 10px;
border-radius: 10px;
background-color: #FFFFFF;
box-shadow: 10px 5px 5px rgba(0, 0, 0, 0.5);
li {
padding-bottom: 4px;
}
li.level1.definition {
list-style: upper-alpha;
}
li.level2.definition {
list-style: decimal;
}
li.level3.definition {
list-style: lower-alpha;
}
li.sub_article > ul {
padding-left: 0px;
}
li.definition.level1, li.definition.level2 {
::marker {
font-weight: bold;
}
ol > li:only-child.level1, li:only-child.level2, li:only-child.level3 {
list-style: none;
}
li:only-child.level1 > ol {
padding-left: 0px;
}
padding-left: 20px;
}
ul li.definition {
list-style: disc;