Skip to content
Snippets Groups Projects
Commit 8fd99c49 authored by Ole Voldsæter's avatar Ole Voldsæter
Browse files

underartikler i boks

parent d5d5ee79
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,7 @@ export default {
name: 'app',
data: function() {
return {
article_id: window.location.href.split("/").pop()
article_id: parseInt(window.location.href.split("/").pop())
}
},
components: {
......
src/assets/logo.png

6.69 KiB | W: | H:

src/assets/logo.png

56.1 KiB | W: | H:

src/assets/logo.png
src/assets/logo.png
src/assets/logo.png
src/assets/logo.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -9,6 +9,7 @@
<script>
import DefElement from './DefElement.vue'
import Example from './Example.vue'
import SubArticle from './SubArticle.vue'
var Definition = {
name: 'Definition',
......@@ -18,7 +19,8 @@ var Definition = {
components: {
DefElement,
Definition,
Example
Example,
SubArticle
},
computed: {
template_name_added: function(){
......@@ -28,7 +30,8 @@ var Definition = {
'template': {
'explanation': 'DefElement',
'definition': 'Definition',
'example': 'Example'
'example': 'Example',
'sub_article': 'SubArticle'
}[element.type] || 'li',
'element': element
}
......
<template>
<li class="sub_article">
<span class="sub_article_header"><a :href="body.article_id">{{article.lemmas[0]['word']}}</a></span>
<ul>
<DefElement :body="body.intro" />
<Definition :body="article.definitions[0]" />
</ul>
</li>
</template>
<script>
import axios from "axios";
import DefElement from './DefElement.vue'
export default {
name: 'SubArticle',
props: {
body: Object
},
data: function(){
return {
article: {
lemmas: [{word: ''}],
definitions: [{
elements: []
}]
}
}
},
components: {DefElement},
mounted: function(){
var self = this;
axios.get('https://search-ordbok-prototype-6qpfmm6fz5jvy5ba3e6blryeqe.eu-west-1.es.amazonaws.com/ordbok/_doc/' + self.body.article_id)
.then(response => self.article = response.data._source)
},
beforeCreate: function () {
this.$options.components.Definition = require('./Definition.vue').default
}
}
</script>
<style scoped>
.sub_article_header {
font-weight: bold;
}
li.sub_article {
padding-top: 8px;
}
li.sub_article ul {
padding-top: 0px;
}
li.sub_article ul li {
list-style: none;
}
</style>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment